How to use it

  1. Choose a common schedule from Quick start, or type the five fields yourself.
  2. Add the command you want to run (optional).
  3. 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-5 is a range (Monday to Friday in the day of week field).
  • 1,15 is a list (the 1st and 15th).
  • */10 is a step (every 10 minutes in the minute field).
  • Shortcuts such as @daily, @weekly and @reboot also 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 timedatectl on the server if they differ.
  • Day of month and day of week are combined with OR when both are set. 0 9 1 * 1 runs 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, not aws) 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>&1 to 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.