User Tools

Site Tools


cs:crontab
Return to Home page

Differences

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


cs:crontab [2024/04/08 22:34] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Crontab ======
 +A linux demon useful to schedule tasks (i.e., execute some scripts).
  
 +To edit ''contab'' file:
 +<code bash>
 +crontab -e
 +</code>
 +
 +To list the scheduled tasks:
 +<code bash>
 +crontab -l
 +</code>
 +
 +Example:
 +<code bash>
 +0 3 * * * /home/user/crontab_backup.sh > /dev/null 2> /home/user/crontab_backup.error
 +</code>
 +this command executes the script ''crontab_backup.sh'' that is in the directory ''/home/user'' every day at 3am. The output of the script is discharged (i.e., ''stdout'' is redirected to ''/dev/null''), while errors (writes on ''stderr'') are redirected in the ''crontab_backup.error'' located in the directory ''/home/user''.
 +
 +Examples regarding the scheduling:
 +  * ''0 3 * * 2,4,6'' : The command is executed at 3am the days of the week number with numbers 2, 4 and 6 (numbers are: 0-Sunday, 1-Monday, 2-Tuesday, 3-Wednesday, 4-Thursday, 5-Friday, 6-Saturday)
 +  * ''30 3 * * *'' : The command is executed at 3:30am every day
 +  * ''30 3 1 * *'' : The command is executed ad 3:30am every first day of every month

If you found any error, or if you want to partecipate to the editing of this wiki, please contact: admin [at] skenz.it

You can reuse, distribute or modify the content of this page, but you must cite in any document (or webpage) this url: https://www.skenz.it/cs/crontab?rev=1551188037&do=diff

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki
Privacy Policy