RE: [PHP] Is CRON'd PHP script already running?
How do i do that exactly? Cheers Simon -Original Message- From: Richard Heyes [mailto:[EMAIL PROTECTED]] Sent: 20 September 2001 18:38 To: [EMAIL PROTECTED] Subject: RE: [PHP] Is CRON'd PHP script already running? ...in perl check to see if the process is already running, and if so exit... Or just do this at the top of the cron'ed php script. -- Richard Heyes I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones. - Albert Einstein -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is CRON'd PHP script already running?
i'm sure there are more elegant solutions, but you could control the running of your php script via a perl script called by cronin perl check to see if the process is already running, and if so exit, else start it jack -Original Message- From: Simon Kimber [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 20, 2001 1:13 PM To: [EMAIL PROTECTED] Subject: [PHP] Is CRON'd PHP script already running? Hi All, I have a PHP script that i want to run every few minutes (via cron) but I only want it to run if it isn't already running. Is there something in cron itself to solve this or is there a way within PHP to detect that another instance of the current script is running and if so exit the new instance before it does anything... eg. I could have a function to use like so: if (already_running($SCRIPT_NAME)) { exit(); } Thanks in advance! Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is CRON'd PHP script already running?
...in perl check to see if the process is already running, and if so exit... Or just do this at the top of the cron'ed php script. -- Richard Heyes I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones. - Albert Einstein -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is CRON'd PHP script already running?
On 20-Sep-2001 Simon Kimber wrote: Hi All, I have a PHP script that i want to run every few minutes (via cron) but I only want it to run if it isn't already running. Is there something in cron itself to solve this or is there a way within PHP to detect that another instance of the current script is running and if so exit the new instance before it does anything... eg. I could have a function to use like so: if (already_running($SCRIPT_NAME)) { exit(); } Thanks in advance! in a shell wrapper: #!/bin/sh mkdir $HOME/LCK.script /dev/null 21 || exit 1; ... do_yer_thang rmdir $HOME/LCK.script Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]