Re: Run script every 30 seconds
| From: | Richard Lynch | Date: | Mon, 30 Oct 2006 21:30:33 +0000 |
| Subject: | Re: Run script every 30 seconds | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-243913@lists.php.net to get a copy of this message | ||
On Mon, October 30, 2006 11:29 am, Ahmad Al-Twaijiry wrote:
> I have a script that I want it to run every 30 seconds, the problem is
> that cronjob can run every 1 minute only, do you have any solution ?
Run a script that never quits with:
http://php.net/usleep
while (true){
//your script here
usleep(30000); //30000? rtfm.
}
It won't really really be every 30 seconds, because the script itself
takes time, but it's about as close as you are likely to get without a
ton of probably un-needed work...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?