Skip to content

Instantly share code, notes, and snippets.

@TheRedDev
Forked from wesleyit/crontab_header.sh
Last active July 4, 2024 23:18
Show Gist options
  • Save TheRedDev/ee6c99e4fb6c8c42eea97b3870536cf5 to your computer and use it in GitHub Desktop.
Save TheRedDev/ee6c99e4fb6c8c42eea97b3870536cf5 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.
## 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
##
## Entry Equivalent Description
## @yearly 0 0 1 1 * Run once a year at midnight in the morning of January 1
## @annually 0 0 1 1 * Run once a year at midnight in the morning of January 1
## @monthly 0 0 1 * * Run once a month at midnight in the morning of the first of the month
## @weekly 0 0 * * 0 Run once a week at midnight in the morning of Sunday
## @daily 0 0 * * * Run once a day at midnight
## @hourly 0 * * * * Run once an hour at the beginning of the hour
## @reboot Run at startup
##
## ┌────────────────────────────────────── min (0 - 59)
## │ ┌────────────────────────────── hour (0 - 23)
## │ │ ┌────────────────────── day of month (1 - 31)
## │ │ │ ┌────────────── month (1 - 12)
## │ │ │ │ ┌────── day of week (0 - 7) (0 or 7 are Sunday, or use names)
## ┴ ┴ ┴ ┴ ┴
## * * * * * command to be executed
## ---------------------------------------------------------------------------------------------
## 0 0 * * * /home/<user>/bin/daily-midnight-script-example.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment