Message-Id: <200604212241.k3LMfofI005299@delorie.com> X-Spam-Check-By: sourceware.org X-DN-AuthenticatedSender: KHP4FFR6EFCRWRUHUHPAUL9TY3J7M6YN-EfYTik0VuLYzt8UPvmY4qQuqfocTvnyVUYOkrst+0/KxPLdgstrCcxSjakLEceyoOjxQsoP4Cy0=--- From: "siegfried" To: Subject: How to prevent duplicate cron jobs? Date: Fri, 21 Apr 2006 16:41:33 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-reply-to: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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/