cron

A time-based execution daemon.

Notes

Installation

Make sure you have both cron and anacron installed (anacron is not installed by default on Ubuntu Server).

Simple scheduling

You can now schedule simple tasks by placing script files in:

Scripts must:

Confirmation

To confirm a script is recognised:

sudo run-parts --report --test /etc/cron.hourly # or daily, etc
# lists all recognised scripts

To execute all scripts:

sudo run-parts --report /etc/cron.hourly # or daily, etc
# executes *all* scripts

References:
https://askubuntu.com/questions/7676
https://askubuntu.com/questions/36971
https://serverfault.com/questions/135906 (includes kickoff on other distros)

Supervisor

You can schedule :supervisor tasks (see that page for details).

Complex scheduling

Add crontab files to /etc/cron.d/
See https://help.ubuntu.com/community/CronHowto#Crontab_Lines for formatting

Notes
0 = Sunday and 7 = Sunday ( https://stackoverflow.com/questions/18919151/crontab-day-of-the-week-syntax#18919183 )
TODO: find better formatting docs

Further reading

Overview
https://askubuntu.com/questions/2368
https://help.ubuntu.com/community/CronHowto

man pages
http://linux.die.net/man/5/crontab
http://linux.die.net/man/8/anacron

History behind the default times
https://askubuntu.com/questions/149490/what-is-the-story-behind-the-default-times-set-in-etc-crontab



Backlinks: supervisor

CC0 / Public domain dedication To the extent possible under law, d3vid seaward has waived all copyright and related or neighboring rights to "cron in Grasmere notebook, including code snippets" (why? how?)