May 2017
Beginner
552 pages
28h 47m
English
You can create a cron job to schedule backups at regular intervals.
A sample is as follows:
$ crontab -ev
Add the following line:
0 */10 * * * rsync -avz /home/code user@IP_ADDRESS:/home/backups
The preceding crontab entry schedules rsync to be executed every 10 hours.
*/10 is the hour position of the crontab syntax. /10 specifies executing the backup every 10 hours. If */10 is written in the minutes position, it will execute every 10 minutes.
Have a look at the Scheduling with a cron recipe in Chapter 10, Administration Calls, to understand how to configure crontab.