Theuerkorn Johannes wrote:

> Hello List,
> 
> i have a perl script that i have running from a cron Job. It usually opens
> every 4 hours. But sometimes it takes the script longer to execute its job
> so after cron opens up the perl script as usual, i have two perl jobs
> running. Is there any possibility to check weather the script is already
> running? Maybe i can use a system command in the crontab?
> 
> any help welcoe
> 
> greets Johannes

try the Proc::ProcessTable module. example to find a process 'running.pl':

#!/usr/bin/perl -w

use strict;
use Proc::ProcessTable;

my $t = new Proc::ProcessTable;

foreach my $p (@{$t->table}){
        if($p->cmndline =~ /running\.pl/){
                print $p->cmndline," already running!\n";
                last;
        }
}

__END__

david

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to