Scheduling
CRON
crontab files are stored in /var/spool/cron.
Crontab command is used to install, remove, list or edit the crontab files.
# crontab -u <username> <file_name> # crontab -e # To edit the crontab files # crontab -l # to display the contents of crontab file # crontab -r # to remove the crontab file
Fields of Crontab file is:
Minute Hour Day_of_Month Month Day_of_week Command
at
# at 9.00am April 5 at> rm /tmp/* # atq # lists the pending jobs scheduled with at # at -l # same as above # atrm <job_number> # cancels a job that is pending # at -d <job_number> # same as above atrm #
System crontab files
- Different format than user crontab files
- Master crontab file /etc/crontab runs executables in the following directories
- /etc/cron.hourly
- /etc/cron.daily
- /etc/cron.weekly
- /etc/cron.monthly
- /etc/cron.d/ directory contains additional system crontab files.