Checking if a script is already running ...

Checking if a script is already running ...

 

  

Hi all,

Does anyone have a smarter script to check whether a certain script is already
running and if so exit from the script instead of running another instance of
the script?

At the moment, am checking it using ps -ef | grep [scriptname], but found out
that this is not a reliable test as someone could be more'ing or cat'ting a
file and I am mistakenly taking it as the script running ...

Any advise or tips will be very much appreciated ... thanks in advance ...




Oracle LazyDBA home page