Re: Ensure only one instance of a script is running
| From: | Raj Shekhar | Date: | Wed, 16 Mar 2005 19:21:02 +0000 |
| Subject: | Re: Ensure only one instance of a script is running | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-210913@lists.php.net to get a copy of this message | ||
"Mikey" <frak@totalise.co.uk> writes:
>
> How about grabbing the output from
ps -ax and looping
> thourhgthe results
> to see if your script is being run?
Again the problem is of atomicity. This is a multi step process
- do a ps -aux
- do a grep on the output
- start script processing
What if second script between step 1 and 2 ? That is why we need
something that is guaranteed to complete in 1 step.
--
Raj Shekhar Y! : Operations Engineer
MySQL DBA, programmer and slacker Y!IM : lunatech3007
home : http://rajshekhar.net blog : http://rajshekhar.net/blog/