Re: ksh script question



I like to use a marker file.  It works great if you have a job that takes longer to run than its frequency interval :) 
 
# Begin Script
semfn=/tmp/`basename $0`.${sid}.RUNNING    # Semaphore Filename, Are we running already?
if [ -f $semfn ]
then
        echo "%-Warn, $0 is Already Running, to continue: rm $semfn"
        return 1
fi
touch $semfn                             
 
# ... Processing stuff
 

rm $semfn               # We are done, so delete semaphore
# End Script

>>> mschlechte@xxxxxxxxx 01/26/06 2:39 PM >>>
If I have a script scheduled via cron how do I check to see if it is already running and therefore not run it a second time?
 
TIA, Mark
DISCLAIMER: The information transmitted is intended only
for the addressee and may contain confidential,
proprietary and/or privileged material. Any
unauthorized review, distribution or other use
of or the taking of any action in reliance upon
this information is prohibited. If you received
this in error, please contact the sender and
delete or destroy this message and any copies.

As of January 20, any e-mails addressed
to "cityregina.com" will not be delivered.


Relevant Pages

  • Re: ksh script question
    ... > If I have a script scheduled via cron how do I check to see if it is already running and therefore not run it a second time? ... > DISCLAIMER: The information transmitted is intended only ... > unauthorized review, distribution or other use ...
    (AIX-L)
  • ksh script question
    ... If I have a script scheduled via cron how do I check to see if it is already running and therefore not run it a second time? ... unauthorized review, distribution or other use ... of or the taking of any action in reliance upon ...
    (AIX-L)
  • Re: If Either Don 2 or Mudge is Lurking....Drop in and say..Hello !
    ... Paul and Mark (who has just moved to Germany ... (since I was 68 for the second time). ... Bigbazza..Oz ...
    (uk.people.silversurfers)
  • Re: mathematician salaries
    ... > In Mark's dozens of posts, Mark does occasionally allude to the fact ... Note the spelling and the meaning. ... This is the second time I ... double doctorate. ...
    (sci.math)
  • Re: Disable Alert
    ... Mark L. Ferguson ... to check the box, OK, restart windows, uncheck the box, OK, and restart a ... second time. ...
    (microsoft.public.windowsxp.help_and_support)