Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop the "twin"

Status
Not open for further replies.

fsqueeen

Programmer
Jul 8, 2002
43
0
0
MY
hi, my question is...

How to stop a perl script (a.pl) from running if the a.pl is currently in running state

Those reload, or human error is un-avoidable, so i hope script can stop themselve when they saw a "twin" there.

thanks
 
The old method used to be placing a var in a text file at the start of the script and setting it to zero at the end.
I use this method very successfully although there is probably a more elegant solution.
The script will not run again if the previous running failed in some way but I overcome that with the var I use, epoc time value, a quick check of it's value how long since the last run. If over a given time, (you decide the duration) then run it again.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top