Re: Looking for ideas on scheduling

From: Date: Fri, 28 Jan 2005 18:59:30 +0000
Subject: Re: Looking for ideas on scheduling
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-207622@lists.php.net to get a copy of this message
Chris W. Parker wrote:
Hello, I'm looking to make a simple scheduler for myself and I'd like to get some feedback on how to handle the events and their being executed at the right time. The two options I've come up with both involve adding a job(s) to crontab. 1. Individual jobs are added to the users crontab file. This could result in LOTS of entries in crontab, but less load on the server. 2. There is one job put in the crontab file that is executed every five minutes. This job will be executing a PHP file that runs through the database for the current user and checks to see if any events need to go off at that time. This will result in only one event in crontab with a greater potential for load on the server. I'm leaning towards Option 2*. What do you think? What other options do I have?
while(1) { if ($fiveMinuteHavePast == true) { // check/run jobs } } but my guess is it will leak... which means you'd have to restart it again... probably with a cronjob :-)
Chris. * Hurray for Option magazine!


« previous php.general (#207622) next »