Crontab is used to schedule commands to be executed periodically.
Cron is a daemon process, which means it runs continuously in the background, waiting to run a specified operation at predefined times.
Cron Files
/etc/crontab
/etc/cron.d
/var/spool/cron<username>
/etc/cron.*
/etc/cron.daily, cron.hourly, cron.monthly, cron.weekly.
This files contain scripts that are run daily, hourly, weekly or monthly respectively, place scripts there be executed inregular intervell.
Lines that can be in the crontab file.
minute (0-59),
hour (0-23),
day of the month (1-31),
month of the year (1-12),
day of the week (0-6 with 0=Sunday).
Options Explanation
* Is treated as a wild card. Meaning any possible value.
*/5 Is treated as ever 5 minutes, hours, days, or months. Replacing the 5 with another
numerical value will change this option.
2,4,6 Treated as an OR, so if placed in the hours, this could mean at 2, 4, or 6 o-clock.
9-17 Treats for any value between 9 and 17. So if placed in day of month this would be
days 9 through 17. Or if put in hours it would be between 9 and 5.
Commands
crontab : Add a crontab entry for the cron users.
crontab -u john -e : Add a crontab entry for user john
crontab -u carl /var/spool/cron/john : Copy the crontab file of john located in the /var/spool/cron/cron.* for user carl.
crontab -l :List crontab entries.
crontab -r : Remove the current crontab entry.
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.