On Fri, Aug 29, 2008 at 6:51 AM, Heston James <heston_james@l ive.co.ukwrote:
Why not look at the process list, and if you find two entries kill the
one that is just starting?
--
Stand Fast,
tjg. [Timothy Grant]
Good afternoon all.
>
I have an application/script which is launched by crontab on a regular
basis. I need an effective and accurate way to ensure that only one instance
of the script is running at any one time.
>
After a short look around the internet I found a couple of examples, such as
this one (http://code.activestate.com/recipes/474070/), however they both
seem to be focused on a windows based environment.
>
Can anyone offer their advice on how best to do this on a linux based
system?
>
I have been contemplating the idea of creating a pidfile which is destroyed
at the end of the script, will this suffice? is it fool proof? My only
concern with this is that if the script crashes or is stopped halfway
through processing for whatever reason, I'll be left with a dead pidfile on
the system and no successive runs will work.
>
I'm really interested to get your ideas guys, Thanks.
>
Heston
>
_______________ _______________ __
Get Hotmail on your mobile from Vodafone Try it Now!
--
>
>
I have an application/script which is launched by crontab on a regular
basis. I need an effective and accurate way to ensure that only one instance
of the script is running at any one time.
>
After a short look around the internet I found a couple of examples, such as
this one (http://code.activestate.com/recipes/474070/), however they both
seem to be focused on a windows based environment.
>
Can anyone offer their advice on how best to do this on a linux based
system?
>
I have been contemplating the idea of creating a pidfile which is destroyed
at the end of the script, will this suffice? is it fool proof? My only
concern with this is that if the script crashes or is stopped halfway
through processing for whatever reason, I'll be left with a dead pidfile on
the system and no successive runs will work.
>
I'm really interested to get your ideas guys, Thanks.
>
Heston
>
_______________ _______________ __
Get Hotmail on your mobile from Vodafone Try it Now!
--
>
one that is just starting?
--
Stand Fast,
tjg. [Timothy Grant]
Comment