Changes

Jump to: navigation, search

Crontab tutorial

883 bytes added, 10:44, 11 June 2019
Examples for crobtab entries
*A , separated list of numbers
*Month and day of week can be short words (or ranges or lists of words)
 
===Shortcuts for crontab Entries===
 
Below are a listing of shortcut keywords (in bold) can can be used to represent the fields.
 
You would still have to specify the command or program to run.
 
<span style="font-family:courier">
'''@reboot''' Run once, at startup.<br>
'''@yearly''' Run once a year (replaces: 0 0 1 1 *)<br>
'''@monthly''' Run once a month (replaces: 0 0 1 * *)<br>
'''@weekly''' Run once a week (replaces: 0 0 * * 0)<br>
'''@daily''' Run once a day (replaces: 0 0 * * *)<br>
'''@hourly''' Run once an hour (replaces: 0 * * * *)<br>
</span>
 
==Examples for crontab entries==
 
Here are some examples of crontab entries for automating backup:
 
 
'''@reboot rsync -avz 192.168.10.158:/etc /backup/vm1/''' # Remotely backup changes to /etc/ files in vm1
 
'''0 2 * * * rsync -avz 192.168.10.158:/etc /backup/vm1/''' # Backup at 2:00 am everyday
13,420
edits

Navigation menu