linux_wiki: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
Next revision Both sides next revision
linux_wiki:cron [2017/09/03 17:47]
billdozor [Automation Example]
linux_wiki:cron [2017/09/03 17:50]
billdozor [Automation Example]
Line 143: Line 143:
 In this example, we want a script to execute on the 1st, 2nd, and 3rd Tuesday of every month, with different arguments depending upon which Tuesday it is. In this example, we want a script to execute on the 1st, 2nd, and 3rd Tuesday of every month, with different arguments depending upon which Tuesday it is.
  
-  Cron entry: Execute a date checker script every Tuesday +  Cron entry: Execute a date checker script every Tuesday 
-    Create the system wide cron entry (/etc/cron.d/automated_job)<code bash># .---------------- minute (0 - 59)+    Create the system wide cron entry (/etc/cron.d/automated_job)<code bash cron-automated-jobs># .---------------- minute (0 - 59)
 # |  .------------- hour (0 - 23) # |  .------------- hour (0 - 23)
 # |  |  .---------- day of month (1 - 31) # |  |  .---------- day of month (1 - 31)
Line 156: Line 156:
 00 08 * * tue  root  /automation/automated-job-check.sh 00 08 * * tue  root  /automation/automated-job-check.sh
 </code> </code>
-  - Date checker script: Determine if the actual automated program should run and what arguments to send it. + 
-    Create the date checker script (/automation/automated-job-check.sh)<code bash>#!/bin/bash+  * Date checker script: Determine if the actual automated program should run and what arguments to send it. 
 +    Create the date checker script (/automation/automated-job-check.sh)<code bash automated-job-check.sh>#!/bin/bash
 # Title: automated-job-check.sh # Title: automated-job-check.sh
 # Description: Determine if an automated job should be run # Description: Determine if an automated job should be run
Line 196: Line 197:
 echo -e "==== Log Ended: $(date) ====\n" >> ${log_file} echo -e "==== Log Ended: $(date) ====\n" >> ${log_file}
 </code> </code>
-    - The above date checker script +
 ---- ----
  
  • linux_wiki/cron.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)