Schedule::Cronchik - a cron-like addition to CGI scripts or something like it.
use Schedule::Cronchik; my $cron = new Schedule::Cronchik("0,10,20,30,40,50 * * * *", \&do_regular_task, "/tmp/lr.mark"); $cron->run();
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.
new(entry,coderef,markfile)
create a new Schedule::Cronchik object.
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 coderef was executed
Ivan Frolcov ifrol@cpan.org
To install Schedule::Cronchik, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Schedule::Cronchik
CPAN shell
perl -MCPAN -e shell install Schedule::Cronchik
For more information on module installation, please visit the detailed CPAN module installation guide.