Eggheads: Scripting help?

Simon Shine simon at
Tue Jun 21 07:18:46 CST 2005

Hash: SHA1

M. Tolga Özses wrote:
| I don't see how that will help me with my request which is sending a
| specific file on a timed basis. It already contains the ftp protocol.
| What I'm looking for is how to use bind time in this script.

Oh. Well, have you had time to look at any examples of how it's done?
Did you look in the documentation in tcl-commands.doc? Allow me to
complain, because I see no trace of effort.


~    (37) TIME (stackable)
~         bind time <flags> <mask> <proc>
~         proc-name <minute> <hour> <day> <month> <year>

~         Description: allows you to schedule procedure calls at certain
~           times. mask matches 5 space separated integers of the form:
~           "minute hour day month year". minute, hour, day, month have a
~           zero padding so they are exactly two characters long; year is
~           extended to four characters in the same way.
~         Module: core

an example:

bind time -|- "0 * * * *" time:foobar
proc time:foobar {min hour day mon year} {
~    putlog "One hour passed."
~    set fd [::ftp::open ...]
~    ...

The <mask> argument's syntax isn't as complex as some cron daemons, so
you can't do things like "*/6 * * * *" for ever ten minutes, or any of
those smart "@reboot" tags and the like. So you're forced to loop.

# example: every fifteenth minute of the hour
foreach m {0 15 30 45} {
~    bind time -|- "$m * * * *" time:foobar
# example: every seventh minute of the hour
for {set m 0} {$m < 60} {incr m 7} {
~    bind time -|- "$m * * * *" time:foobar

- --
Best regards,
Simon Shine <> GPG Key ID: 0x7BAEDE28
Version: GnuPG v1.4.0 (MingW32)
Comment: Using GnuPG with Thunderbird -


More information about the Eggheads mailing list