Support Requests item #558351, was opened at 2002-05-20 10:14
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=203152&aid=558351&group_id=3152
Category: Configuration: First-Time Startup
Group: aolserver3_2
Status: Open
Resolution: None
Priority: 5
Submitted By: Paul Grady (paulgrady)
Assigned to: Nobody/Anonymous (nobody)
Summary: Using ns_schedule_proc
Initial Comment:
I have a need to schedule TCL scripts to run at pre-
defined intervals. Ideally, I would like the server to
execute a single script once every hour. That script
could in turn execute other user definable scripts
when appropriate. I would like the process to start
when the server is started.
ns_schedule_proc sounds like it would be ideal for
this. My question is, how can I execute
ns_schedule_proc at startup. I tried to source the
procedure to be executed and place the
ns_schedule_proc in nsd.tcl. However the server had
not yet sourced the procedure to be executed and gave
me an error.
Any help would be greatly appreciated!
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2002-05-20 10:25
Message:
Logged In: NO
---- mycode.tcl ----
proc my_hourly_proc { } {
#
# do stuff here
#
}
ns_share my_timer
if [info exists my_timer] {
ns_unschedule_proc $my_timer
}
set my_timer [ns_schedule_proc -thread 3600 my_hourly_proc]
---- mycode.tcl ----
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=203152&aid=558351&group_id=3152