This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

proc run schedule

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

proc run schedule

Post by ultralord »

bind time {40 * * * *} myproc

is that correct?
i think no :P
how i can do that to run my command every 40 minites?
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Post by tomekk »

try:

Code: Select all

bind time - "40 * * * *" my_proc
for test change 40 to 2 or smth ;p
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Actually, the use of "" or {} does not matter in this case, as there is nothing to be substituted in the preprocessing phase.

What is to be kept in mind, however, is that the mask is matched against "minute hour day month year" every minute. If the mask matches, the associated command is evaluated. In your case, it means the command will be triggered once every hour, twenty minutes to the hour (01:40, 02:40, 03:40 ... 23:40).

To trigger something every 40 minutes, your best option is most likely to use a recursive 40min timer.. Most basic version is shown below:

Code: Select all

proc someproc {} {
 ...

 #Now a recursive call
 timer 40 [list someproc]
}
NML_375
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

eh.. :s easy answer thnx stupid question :S run one timer 40 and inside again timer.. ix.


thanx :D
Post Reply