Open main menu

CDOT Wiki β

Changes

Crontab tutorial

306 bytes added, 10:44, 11 June 2019
Examples for crobtab 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. None<br>'''@yearly''' Run once a year (replaces: 0 0 1 1 *'''@annually''' (same as @yearly) 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>'''@midnighthourly''' Run once an hour (same as @daily) 0 replaces: 0 * * **)<br></span> ==Examples for crontab entries== Here are some examples of crontab entries for automating backup:  '''@hourlyreboot rsync -avz 192.168.10.158:/etc /backup/vm1/''' # Remotely backup changes to /etc/ files in vm1 ''' Run once an hour 0 2 * * * * rsync -avz 192.168.10.158:/etc /backup/vm1/''' # Backup at 2:00 am everyday
13,420
edits