My question is how can I do this if I have three or more jobs which runs at different intervals? Can it be possible to put above in a sub and do a foreach of different intervals/scripts to be executed? I'm thinking of a timer kind of thing which forks(parallel forks if more), execs respective script and kills child after.my $interval = 300; my $cpid = fork(); my $upto = localtime() + $interval; while (1) { if ($upto == localtime()) { $upto = localtime() + $interval; system("/home/rambo/perl-assignments/send_test_mail.pl"); } sleep 1; }
In reply to cron functionality mimic in perl scripting by coolfire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |