linux_wiki:schedule_tasks_using_at_and_cron

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision Both sides next revision
linux_wiki:schedule_tasks_using_at_and_cron [2016/02/29 21:44]
billdozor created
linux_wiki:schedule_tasks_using_at_and_cron [2016/02/29 21:44]
billdozor [cron]
Line 79: Line 79:
 </code> </code>
   * Executes /home/user/uptimelog as root, every 5 mins   * Executes /home/user/uptimelog as root, every 5 mins
 +
 +----
 +
 +==== Anacron ====
 +
 +Anacron runs all scripts in cron.* directories. This allows jobs to be run if the scheduled time was while a system was powered off.
 +
 +Main config and contents: /etc/anacrontab
 +<code bash>
 +#period in days   delay in minutes   job-identifier   command
 +1 5 cron.daily nice run-parts /etc/cron.daily
 +7 25 cron.weekly nice run-parts /etc/cron.weekly
 +@monthly 45 cron.monthly nice run-parts /etc/cron.monthly
 +</code>
 +
 +Run all anacron jobs(in /etc/anacrontab), ignore timestamps (note that the "delay in minutes" setting is still in effect)
 +<code bash>
 +anacron -f
 +</code>
 +
 +View timestamps for anacron jobs (cron.daily in this example)
 +<code bash>
 +cat /var/spool/anacron/cron.daily
 +</code>
 +
 +Run all jobs now, ignore delay specifications in /etc/anacrontab
 +<code bash>
 +anacron -n
 +</code>
  
 ---- ----
  
  • linux_wiki/schedule_tasks_using_at_and_cron.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)