riddimak has asked for the wisdom of the Perl Monks concerning the following question:

I tried a prg with Schedule::Cron,
it adds a row to the excel sheet, for every 1 min, now i want to stop the process from further running,
I tried $cron->clean_timetable() but still the process is running
Can u tell me the directory in which this scheduler is running
and also how to get pid for this process
The code goes like this
use Schedule::Cron; use Data::Dumper; sub dispatcher { my @details; push(@details,"\nCode \t Name "); open SITE_DETAILS, ">>/home/www/cgi-bin/x/d.xls") or die "Can't open property_details file: $!\n"; print SITE_DETAILS @details; } ##create an empty file crontests.cron my $cron = new Schedule::Cron(\&dispatcher); $cron->load_crontab("/home/www/cgi-bin/x/crontests.cron"); $cron->add_entry("06 01 * * *",\&dispatcher); $cron->run(detach=>1); #$cron->clean_timetable();

Replies are listed 'Best First'.
Re: problem with Schedule::Cron
by muntfish (Chaplain) on May 27, 2005 at 11:31 UTC

    Check the documentation:

    The run method returns the pid of the detached process; alternatively you can specify a file for it to write the pid to:

    # Start scheduler, detach from current process and # write the PID of the forked scheduler to the # specified file $cron->run(detach=>1,pid_file=>"/var/run/scheduler.pid");

    s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&