Forum Moderators: coopster

Message Too Old, No Replies

controling cron from a php script

         

rfontaine

2:08 pm on Nov 9, 2005 (gmt 0)

10+ Year Member



I know how to set up a regular cronjob, but now I have an additional need:

I would to set up a cronjob that is started manually by clicking a submit button on a web form. The cron then runs once every 30-minutes, for example processing x-number of records in a database once every 30-minutes, until it's job is done and then waits until I manually call it again from the web page.

Any ideas on how this can be done?

Tnank you in advance

jatar_k

9:48 pm on Nov 9, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



this can be done, you could sleep() the script. I would be very careful though as it would be simple to eat up resource on the server if you don't properly release all vars etc aftyer every iteration.

This question though makes me think there could be a better way.

Why not just a normal cron? If there was nothing for it to do at that time it could just end.