• Each user has a crontab (cron table) which is a table that you configure schduled tasks
crontab -l # list crontab of user crontab -e # edit user specific crontab
# Example # /var/spool/cron/crontabs/ (user) # m h dom mon dow command 15 10 * * 3-5 echo"$(date): checking in." >> /home/$(whoami)/mycheckin
• 6 fields need to be defined in crontab ◇ minutes ◇ hour ◇ day of month (dom) ▪ * means every day ◇ month of year (mon) ▪ * means every month ◇ day of week (dow) ▪ range: 1 to 7, 1 means monday ◇ user ▪ exist in system-wide crontab only (see below) ◇ command ▪ interpreted by sh
• User defined crontabs are stored in /var/spool/cron/crontabs/ . One for each user • Package specified crontabs are stored in /etc/cron.d • Syetem-wide crontab is stored in /etc/crontab
sudols/var/spool/cron/crontabs/# user specific sudols/etc/cron.d # program specific sudols/etc/crontab # system-wide
# Examples: # /etc/crontab (system-wide) # m h dom mon dow user command 15 10 1-10/2 * 5 root echo"$(date): checkin" >> /var/log/croncheck.log # /2 means every 2 days