Skip to content

Instantly share code, notes, and snippets.

@forestbaker
Last active November 16, 2017 10:30
Show Gist options
  • Save forestbaker/e8cfd6f445884c97135b to your computer and use it in GitHub Desktop.
Save forestbaker/e8cfd6f445884c97135b to your computer and use it in GitHub Desktop.
cron timing cheat sheet
#kudos: Alain Kelder
#+--------------- minute (0-59)
#| +------------- hour (0-23)
#| | +----------- day of month (1-31)
#| | | +--------- month (1-12)
#| | | | +------- day of week (0-7), 0=Sunday
#| | | | | user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
# place custom jobs below
# runs script - sends email to root if script fails
*/15 * * * * www-data drush.cron || mail -s "Error $? running $_" root
# runs script - discard standard output - sends email if script fails
*/15 * * * * www-data drush.cron 1>/dev/null || mail -s "Error $? running $_" root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment