Forum OpenACS Development: Re: Schedule a procedure to run on 1st of every month in project open.

This is how I do monthly scheduled procedures:

ad_schedule_proc -thread t -schedule_proc ns_schedule_daily [list 0 0] proc_name_here

This actually runs the procedure every day at midnight, but the next part is this:

In the procedure you're running daily, check to see which day of the month it is. In my case, I make sure it's the first day of each month at the very beginning. If it's not, then I do nothing, otherwise, the procedure will continue.

if {[clock format [clock seconds] -format "%e"] != 1} { return }

A more elegant method may exist, but this is how I've done it for a long time, and it works fine.

Thanks Nathan,

But, My functionality needs to re-run the procedure as and when required. If I use the way you did then it may only run on the 1st of every month. The case of running it again as and when required will fail. Sorry, for not intimating about this functionality earlier. Please suggest me a way to run the proc on 1st and also the user must have a provision to run it again, if needed..

Thanks again..