How to use it
- Choose a common schedule from Quick start, or type the five fields yourself.
- Add the command you want to run (optional).
- Check the plain-English line and the next five runs, then copy the line into your crontab with
crontab -e.
To check someone else’s cron job, paste the whole line into Explain an existing cron line.
The five fields
┌──────── minute (0 to 59)
│ ┌────── hour (0 to 23)
│ │ ┌──── day of month (1 to 31)
│ │ │ ┌── month (1 to 12, or jan to dec)
│ │ │ │ ┌ day of week (0 to 7, 0 and 7 are Sunday, or sun to sat)
│ │ │ │ │
* * * * * command to run
*means every value.1-5is a range (Monday to Friday in the day of week field).1,15is a list (the 1st and 15th).*/10is a step (every 10 minutes in the minute field).- Shortcuts such as
@daily,@weeklyand@rebootalso work.
Common gotchas
- Cron uses the server’s time zone, not yours. The next runs shown here use your browser’s time zone, so check
timedatectlon the server if they differ. - Day of month and day of week are combined with OR when both are set.
0 9 1 * 1runs on the 1st of the month and every Monday, not only Mondays that fall on the 1st. - Cron has a minimal environment. Use full paths (
/usr/bin/aws, notaws) and set any variables your script needs. Our AWS CLI and cron guide covers this. - Log the output so you can see failures: add
>> /var/log/myjob.log 2>&1to the end of the command.
FAQ
Does it support seconds?
No. Standard cron runs at most once a minute. For anything faster, use a systemd timer or a loop in a script.
