Skip to content

Instantly share code, notes, and snippets.

@ijy
Forked from khalwat/crontab_helper
Created August 17, 2016 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ijy/31117b4f3c3acf4232fb61db0c1c3c27 to your computer and use it in GitHub Desktop.
Save ijy/31117b4f3c3acf4232fb61db0c1c3c27 to your computer and use it in GitHub Desktop.
Never struggle with editing your crontab again; put this in the beginning of each of your crontabs
# * * * * * command to execute
# ┬ ┬ ┬ ┬ ┬
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ └───── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names)
# │ │ │ └────────── month (1 - 12)
# │ │ └─────────────── day of month (1 - 31)
# │ └──────────────────── hour (0 - 23)
# └───────────────────────── min (0 - 59)
# Example: Backup all the hosted sites via shell scripts once per week on Sunday @ 5am
0 5 * * 0 /htdocs/_backups/_scripts/backup_all_sites.sh > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment