[HPADM] Scripting Question

From: Deepak John Cutinha (deepak_cutinha@yahoo.com)
Date: Thu Oct 03 2002 - 06:40:19 EDT


Hi Folks,
 
I have a script running every minute via cron, I want
to stop it running more than once simultaneously.
 
(ie sometimes it takes longer than 1 minute to run,
and I don't want it running twice at the same time)
 
I think adding the following line will prevent this
Can I have your comments please ?
Note, the name of the script is watcher.sh
 
if (ps -ef |grep -v $$| grep -v grep | grep
"watcher.sh" > /dev/null)
then
exit
fi

Is there a better way...

I want to avoid using flag files, since these can
cause problems in the event of a crash
REgards
 
DJC

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:20 EDT