Auto adding cronjobs is likely a bad idea. Speaking UN*X terms here,some systems have an /etc/cron.d/cron.allow which needs the username added before the user is allowed to add a cronjob. I really think you are going to need to assume that someone installing your script is a sysadmin or rethink your distribution strategy.
You can make the admin's job easier by providing the pregenerated crontab information like producing a file that can be read-in like
% cronatab -e < crontoload.in
But know that admins may want to put scripts in certain places so you probably can't assume that your crontab will work perfectly every time depening on where perl is installed, the module dependancies, etc. I think that you are going to have to assume some sort of computer competency if someone is running linux and needs to run your script to optimize your CGI script's performance.
As for pure-perl solutions, you could consider Schedule::Cron but I'm not sure how safe it is having never used it. It would run as userlevel daemon and if your webserver is running as nobody you won't be able to cleanup files produced by it.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.