delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/04/21/18:41:51

Message-Id: <200604212241.k3LMfofI005299@delorie.com>
X-Spam-Check-By: sourceware.org
X-DN-AuthenticatedSender: KHP4FFR6EFCRWRUHUHPAUL9TY3J7M6YN-EfYTik0VuLYzt8UPvmY4qQuqfocTvnyVUYOkrst+0/KxPLdgstrCcxSjakLEceyoOjxQsoP4Cy0=---
From: "siegfried" <siegfried AT heintze DOT com>
To: <cygwin AT cygwin DOT com>
Subject: How to prevent duplicate cron jobs?
Date: Fri, 21 Apr 2006 16:41:33 -0600
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook, Build 11.0.6353
In-reply-to: <e2blha$nun$1@sea.gmane.org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

I apologize if this is sent twice. I sent it once a couple of hours ago and
did not see it appear so I am sending it again.

I have a cron job running perl and it is taking a very long time -- 
sometimes over 24 hours.

How can I have cron schedule my job daily, or even hourly, and have 
the perl code  exit if a previouse instance of the job is still 
running?

Some have suggested creating a file in /tmp and checking it before 
proceding. But what if a cron job exits prematurely, perhaps because 
of a division by zero, and does not delete the /tmp file?

Others have suggested checking /proc (which seems to exist in cygwin :)) for
my pid and send a semaphore or a SIGUSR1 to determine if it's not hung.
 
Will this work in cygwin? 

Thanks,

Siegfried


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019