On Tue, Nov 27, 2001 at 03:23:21PM -0800, Daniel Meier wrote:
> I want to cron/at a bash script but have it check to see if another instance of the 
>script is already running.
> 
> I did a ps -Wl and a ps -ef while I had the script running and while I saw the 
>/usr/bin/bash executables (my current shell and the shell I wanted to detect) they 
>did not contain enough information to differentiate between the two shells.
> 
> Any ideas of how I can determine this? I thought of using a temp file, but if the 
>script terminates abnormally it might not cleanup it's files, causing the next cron 
>job to not run, thinking that the other script is still running.

A temp file /var/run/<yourTask>.pid containing the PID of the process
should give the information you need.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:[EMAIL PROTECTED]
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Reply via email to