Skip to content

Instantly share code, notes, and snippets.

@bf4648
Forked from wesleyit/crontab_header.sh
Created April 26, 2021 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bf4648/5e04e984b26795af6d57ed3b44170d24 to your computer and use it in GitHub Desktop.
Save bf4648/5e04e984b26795af6d57ed3b44170d24 to your computer and use it in GitHub Desktop.
A default crontab header that will make the life easier for those who don't remember cron fields or keywords.
## CRONTAB HINTS AND TIPS
##
##
## Entry Description Equivalent To
## @yearly (or @annually) Run once a year at midnight in the morning of January 1 0 0 1 1 *
## @monthly Run once a month at midnight in the morning of the first of the month 0 0 1 * *
## @weekly Run once a week at midnight in the morning of Sunday 0 0 * * 0
## @daily Run once a day at midnight 0 0 * * *
## @hourly Run once an hour at the beginning of the hour 0 * * * *
## @reboot Run at startup @reboot
##
## * * * * * command to be executed
## ┬ ┬ ┬ ┬ ┬
## │ │ │ │ │
## │ │ │ │ │
## │ │ │ │ └───── day of week (0 - 7) (0 or 7 are Sunday, or use names)
## │ │ │ └────────── month (1 - 12)
## │ │ └─────────────── day of month (1 - 31)
## │ └──────────────────── hour (0 - 23)
## └───────────────────────── min (0 - 59)
##
##
##
## The following example will run each 10 minutes
## */10 * * * * /usr/bin/somedirectory/somecommand
## Disable E-mail notifications
MAILTO=""
## Set where to look for executable files
PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin:$PATH
## Ok, we are ready to go. Put your schedules below :-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment