Skip to content

Instantly share code, notes, and snippets.

@Ham5ter
Last active February 12, 2018 11:06
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 Ham5ter/2e2d0caf15ce3e55197dedf989ca1b9c to your computer and use it in GitHub Desktop.
Save Ham5ter/2e2d0caf15ce3e55197dedf989ca1b9c to your computer and use it in GitHub Desktop.
crontab example
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
#
# Aliases:
# string meaning
# ------ -------
# @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 * * *".
# @midnight (same as @daily)
# @hourly Run once an hour, "0 * * * *".
# Examples:
#
# Every 5 Minutes:
# */5 * * * * foobar
@Ham5ter
Copy link
Author

Ham5ter commented Jun 29, 2016

# Backup all mySQL 2:15 am per day.
15 2 * * * root mysqldump -u root -pPASSWORD --all-databases | gzip > /mnt/disk2/database_`date ' %m-%d-%Y'`.sql.gz 

@KeyboardInterrupt
Copy link

Every three hours 0 */3 * * * foobar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment