On my previous post, we've learned how to install rsnapshot on Ubuntu Server 13.10. Now, we will continue the tutorial to create a backup plan to an external drive in daily base using rsnapshot. This backup will be executed daily (once a day).
In this example I want to backup my local directory in /share and I want to save the data in my external drive which is mounted under /mnt/backup
First, make sure the external drive is mounted on the mount directory (/mnt/backup).
sudo mount /dev/sdb1 /mnt/backup
Next we need to edit rsnapshot configuration file
sudo /etc/rsnapshot.conf
Now we need to edit some lines in the configuration file. First, specify the snapshot_root directory. This directory will be used to store all the backup. So, we need to change this to our mounted directory.
snapshot_root /mnt/backup/
Next, we need to edit the backup interval. Since we want to backup in daily base only, we need to disable all other backup interval. See my example below.
#retain hourly 6
retain daily 7
#retain weekly 4
#retain monthly 3
# LOCALHOST
backup /share/ localhost/#backup /etc/ localhost/
#backup /usr/local/ localhost/
#backup /var/log/rsnapshot localhost/
#backup /etc/passwd localhost/
#backup /home/foo/My Documents/ localhost/
Take a look at the bold line above. Thats the active backup points in my conf file. After this we can close the conf file and save it. Now we need to test this configuration file.
sudo rsnapshot configtest
Make sure you get the following result
Syntax OK
Now to start backup, you can execute using
rsnapshot daily
Have a nice day all.