NAME
Schedule::Cronchik - a cron-like addition to CGI scripts or something like it.
SYNOPSIS
use Schedule::Cronchik;
my $cron = new Schedule::Cronchik("0,10,20,30,40,50 * * * *", \&do_regular_task, "/tmp/lr.mark");
$cron->run();
DESCRIPTION
Sometimes I need a task, peformed on regular basis. Unfortunately, not so much hostings allows you to write your own crontabs, and getting a more powerful hosting have too high cost for required task. Well, this module give you a partial solution.
METHODS
new(entry,coderef,markfile)-
create a new Schedule::Cronchik object.
- PARAMETERS
-
entry-
a cron-like entry with same behavoir. Note: the last field, a week day, now is simply ignored. Also Vixie-like extensions is not supported, only sequences with ',' and ranges with '-'
coderef-
a reference to code to run when at desired time
markfile-
a filename for file where information about last run will be stored
run()-
a method to start execution of specified tasks. Return 0 if nothing happened or 1 when
coderefwas executed
AUTHOR
Ivan Frolcov ifrol@cpan.org