public
Last active

Cron Cheat Sheet

  • Download Gist
cron_cheatsheet
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# Cron cheatsheet
#
# * * * * * command to be executed
# - - - - -
# | | | | |
# | | | | +- - - - day of week (0 - 6) (Sunday=0)
# | | | +- - - - - month (1 - 12)
# | | +- - - - - - day of month (1 - 31)
# | +- - - - - - - hour (0 - 23)
# +- - - - - - - - minute (0 - 59)
 
# Alarm clock set to 6:30AM
# 30 6 * * * /home/nano/alarm
 
For several fields, you may denote subdivision by using the forward-slash (/) character. To execute a job every 5 minutes, */5 in the minutes field would specify this condition.
 
Spans may be indicated using the dash (-) character. To execute a job Monday through Friday, MON-FRI should be used in the day-of-week field.
 
Multiple values may be separated using the comma (,) character. The specification of 1,15 in the day-of-month field would result in the job firing on the 1st and 15th of each month.
 
Either day-of-month or day-of-week must be specified using the ? character, since specifying both is contradictory.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.