Each user which has access to cron, will be able to run the command called crontab. Cron matches the first 5 fields of each crontab entry, and if the system date/time matches with the entry, then the command is executed. There is a seperate crontab for each user, including root.
As each user, you could run
crontab -e
The type vi commands to edit the crontab file. (i to insert, r to replace one char, x to delete a char, then type :q! to quit without save, or :wq to exit and save changes)
The crontab command is in this form:
Hour Minute DayOfMonth MonthOfYear DayOfWeek /someprogram args
Use * to indicate match any value of that field
Here's an example for sunday at 6am
6 0 * * 0 /bin/ls > /tmp/ls.txt
The 5th field is 0 for Sunday, fields are 0 through 6 for Sunday through Saturday. The day of month should have values from 1 to 31. You can do ranges like 1-31 or comma ranges like 0,5,10,15,20,25,30,35,40,45,50,55,60 (notice no spaces, because that moves to the next field) in the Minute field to run the command every 5 minutes.
Good luck,
I'm not sure on editing crontabs with perl, but the crontab file is an ascii file, but there are probably considerations to take into account with writing to the file, as cron constantly reads the file.
Probably you can do your crontab as a perl input file, and then run
crontab createdFile.txt
to install the new cron file (the entire thing)
Good luck again.
|