[[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

Both sides previous revision Previous revision
Next revision
Previous revision
linux_wiki:schedule_tasks_using_at_and_cron [2016/03/01 02:44]
billdozor [cron]
linux_wiki:schedule_tasks_using_at_and_cron [2019/05/26 03:50] (current)
Line 3: Line 3:
 **General Information** **General Information**
  
-About this page/how-to/script+Using system utilities ​to schedule one-off or reoccurring jobs
  
 ---- ----
  
-==== at ====+===== at ====
 at is good for one-off jobs that don't need to reoccur regularly. at is good for one-off jobs that don't need to reoccur regularly.
  
 +\\
 Install, Enable, Start Install, Enable, Start
 <code bash> <code bash>
Line 17: Line 19:
 </​code>​ </​code>​
  
 +\\
 Example Times (teatime is 4pm) Example Times (teatime is 4pm)
 <code bash> <code bash>
Line 26: Line 29:
 </​code>​ </​code>​
  
 +\\
 Example job Example job
 <code bash> <code bash>
Line 33: Line 37:
 </​code>​ </​code>​
  
 +\\
 View jobs View jobs
 <code bash> <code bash>
Line 38: Line 43:
 </​code>​ </​code>​
  
 +\\
 Remove job (cancel job) Remove job (cancel job)
 <code bash> <code bash>
Line 45: Line 51:
 ---- ----
  
-==== cron ====+===== cron =====
  
 cron is for scheduling reoccurring jobs/​scripts. cron is for scheduling reoccurring jobs/​scripts.
  
 +\\
 Edit current user's cron Edit current user's cron
 <code bash> <code bash>
Line 54: Line 61:
 </​code>​ </​code>​
  
 +\\
 System wide System wide
 <code bash> <code bash>
Line 67: Line 75:
 </​code>​ </​code>​
  
 +\\
 More preferred method: Place scripts inside one of the cron.* directories. More preferred method: Place scripts inside one of the cron.* directories.
   * /​etc/​cron.d/​ = system executed jobs (format => /​etc/​crontab)   * /​etc/​cron.d/​ = system executed jobs (format => /​etc/​crontab)
Line 74: Line 83:
   * /​etc/​cron.weekly/​ = weekly executed scripts (format => bash script)   * /​etc/​cron.weekly/​ = weekly executed scripts (format => bash script)
  
 +\\
 Example custom script in /etc/cron.d Example custom script in /etc/cron.d
 <code bash> <code bash>
Line 82: Line 92:
 ---- ----
  
-==== Anacron ====+===== 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. 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 Main config and contents: /​etc/​anacrontab
 <code bash> <code bash>
Line 94: Line 105:
 </​code>​ </​code>​
  
 +\\
 Run all anacron jobs(in /​etc/​anacrontab),​ ignore timestamps (note that the "delay in minutes"​ setting is still in effect) Run all anacron jobs(in /​etc/​anacrontab),​ ignore timestamps (note that the "delay in minutes"​ setting is still in effect)
 <code bash> <code bash>
Line 99: Line 111:
 </​code>​ </​code>​
  
 +\\
 View timestamps for anacron jobs (cron.daily in this example) View timestamps for anacron jobs (cron.daily in this example)
 <code bash> <code bash>
Line 104: Line 117:
 </​code>​ </​code>​
  
 +\\
 Run all jobs now, ignore delay specifications in /​etc/​anacrontab Run all jobs now, ignore delay specifications in /​etc/​anacrontab
 <code bash> <code bash>
  • linux_wiki/schedule_tasks_using_at_and_cron.txt
  • Last modified: 2019/05/26 03:50
  • (external edit)