I apologize, I forgot to mention something very important: I am using
cygwin's cron on Win2003 Server. 

I tried using Unix::PID but ppm.bat for ActiveState Perl could not find it.
Sieg

-----Original Message-----
From: JupiterHost.Net [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 21, 2006 2:45 PM
To: beginners@perl.org
Subject: Re: How to prevent duplicate cron jobs?



siegfried wrote:
> 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?

perldoc Unix::PID

# job.pl that gets cron'ed:

#!/usr/bin/perl

use strict;
use warnings;
use Unix::PID '/var/run/job.pid';

# your code here #

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to