Cron jobs let you schedule tasks to run automatically at specific intervals.
Edit Crontab
crontab -eCron Syntax
# MIN HOUR DAY MONTH WEEKDAY COMMAND
0 2 * * * /path/to/script.shThis example runs at 2:00 AM every day.
Common Schedules
# Every 5 minutes
*/5 * * * * /path/to/command
# Every hour
0 * * * * /path/to/command
# Daily at midnight
0 0 * * * /path/to/command
# Weekly on Sunday
0 0 * * 0 /path/to/command
# Monthly on the 1st
0 0 1 * * /path/to/commandView Cron Jobs
crontab -lCron Output
Redirect output to a log file to debug issues:
*/5 * * * * /path/to/command >> /var/log/mycron.log 2>&1