in reply to How do I determine if my script is already running?

You could always flock() a lockfile, and if the script can not obtain a lock, you know another instance of the script is running.

I generally do this. As well, when starting a file from cron I like to run a shell script from the cron (which will call the Perl script) which greps a ps to see if the script is running (and in some cases if it is being edited in vi). Not sure if others do something similar, but I got into the habbit some years back when we had a policy of doing this (at a past job).

Cheers,
KM

  • Comment on Re: How do I determine if my script is already running?