delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT sources DOT redhat DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT sources DOT redhat DOT com> |
List-Help: | <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT sources DOT redhat DOT com |
Delivered-To: | mailing list cygwin AT sources DOT redhat DOT com |
Date: | Wed, 28 Nov 2001 08:07:15 +0100 |
From: | Corinna Vinschen <cygwin AT cygwin DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: Shell process identification |
Message-ID: | <20011128080715.U14975@cygbert.vinschen.de> |
Mail-Followup-To: | cygwin AT cygwin DOT com |
References: | <006501c1779a$8252add0$2701010a AT crosstrust DOT com> |
Mime-Version: | 1.0 |
User-Agent: | Mutt/1.2.5i |
In-Reply-To: | <006501c1779a$8252add0$2701010a@crosstrust.com>; from dmeier@crosstrust.com on Tue, Nov 27, 2001 at 03:23:21PM -0800 |
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:cygwin AT cygwin DOT com 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |