|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: cron or perl?by andreychek (Parson) |
| on Jun 30, 2001 at 05:42 UTC ( #92861=note: print w/ replies, xml ) | Need Help?? |
|
If you want to have a program sleep, and then run something every 15 minutes, you could write: However, I am the type who would absolutally prefer to use cron to handle timing, as opposed to Perl. Cron is a wonderful resource, and I find it easier to use an existing resource then to recreate one. It's one thing if you will always stick to 15 minutes.. but what if you ever decide you don't want it to run on the weekends? Secondly, by having your Perl program handle the time -- if you ever reboot, you'll need to rerun the program. Or create a startup script to do it for you. What if you end up with 15 of these scripts? Or 50? I would personally find it much easier to manage them with cron. Lastly, a point could be raised about system resources. Having scripts running all the time uses memory. It may be easier on your system resources to have them only run when necessary. The other side of the coin is that depending on the script, it might take a lot of CPU time to fire up that script every 15 minutes, instead of leaving it in RAM where the system may cache it. But you'll have to do some benchmarks to work that out :-) -Eric
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||