A time-based execution daemon.
Make sure you have both cron and anacron installed (anacron is not installed by default on Ubuntu Server).
You can now schedule simple tasks by placing script files in:
- /etc/cron.daily/ (default Ubuntu kickoff is 7.35am, with a 5 min delay between jobs)
- /etc/cron.hourly/ (17 mins past the hour,
- have alphanumeric names, may include hyphen or underscore, may not include period
- start with a shebang
- be executable (sudo chmod +x SCRIPTNAME)
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
You can schedule :supervisor tasks (see that page for details).
Add crontab files to /etc/cron.d/
See https://help.ubuntu.com/community/CronHowto#Crontab_Lines for formatting
0 = Sunday and 7 = Sunday ( https://stackoverflow.com/questions/18919151/crontab-day-of-the-week-syntax#18919183 )
TODO: find better formatting docs
History behind the default times