On Monday 13 June 2005 15:19, Janine Sisk wrote: > I just upgraded several sites from AOLserver 4.0.8 to 4.0.10. I added > the following script to /usr/local/aolserver/modules/tcl/roll-logs.tcl, > as I always do: > > # from Michael Cleverly: > # > http://www.opennsd.org/bboard/q-and-a-fetch-msg.tcl? > msg_id=00005n&topic_id=1&t > opic=OpenNSD > > proc roll_logs {} { > set server_name [ns_info server] > set yesterday [ns_fmttime [expr [ns_time] - 86400] %Y-%m-%d] > set access_file_name [ns_config ns/server/${server_name}/module/nslog > File] > > # access log > ns_accesslog roll $access_file_name.$yesterday > # server log > ns_logroll > } > > ns_share -init {set schedule_roll 0} schedule_roll > if {!$schedule_roll} { > ns_schedule_daily 0 0 roll_logs > ns_log Notice "roll_logs for [ns_info server] has been scheduled at > 12:00 am." > }
I don't see how any of this works the way you described it, and even if it did, you shouldn't need a shared var to run a proc once daily, otherwise we need to change the proc name to ns_schedule_run_once_per_thread_daily. If the above code were to work, I think it would need to create and use a mutex and also increment the shared var. The way to replace ns_share is to use nsv: nsv_set schedule roll 0 nsv_set schedule mutex [ns_mutex create] tom jackson -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
