Scheduling jobs with anacron
When using anacron, we don't care the time the jobs are going to run.
We run to run them daily, monthly or once in few days no matter what time of the day is.
To schedule a job, use /etc/anacrontab:
3 10 test_job /usr/bin/touch /tmp/anacron_job
- 3 - job is run every 3 days. Every week - 7 or @weekly. Every month - use @monthly
- 10 - delay in minutes. If some jobs have been missed to run (while computer was powered off during that day), make a delay of job in minutes to not run all missed jobs in parallel
- test_job - job identifier, used for logging
- command - use full paths when possible as PATH is not set