Posted on

Crontab cheat sheet

For all the Linux admins out there – Add this to the header of all your crontabs.
… and it becomes a lot clearer to anyone reading them…

# *   *   *   *   *      command_to_be_executed
# -   -   -   -   -
# |   |   |   |   |
# |   |   |   |   +----- day of the week (0 - 6) (Sunday=0)
# |   |   |   +--------- month (1 - 12)
# |   |   +------------- day of the month (1 - 31)
# |   +----------------- hour (0 - 23)
# +--------------------- min (0 - 59)
#
# Asterisk    (*)  any value
# Comma       (,)  value list separator (0,20,30,45)
# Dash        (-)  range of values (8-17)
# Slash       (/)  steps values (*/20)
#
# @reboot     Run once, at startup
# @yearly     Run once a year,       "0 0 1 1 *"
# @annually   Same as @yearly
# @monthly    Run once a month,      "0 0 1 * *"
# @weekly     Run once a week,       "0 0 * * 0"
# @daily      Run once a day,        "0 0 * * *"
# @hourly     Run once an hour,      "0 * * * *"

Njoy!