For OpenSUSE 13.1 users, you can use Rsnapshot to backup your files to other storage media. Rsnapshot can be used to backup files to local disk, remote disk over ssh, samba or even to an external drive. On this tutorial I am going to show you how to backup using Rsnapshot command on OpenSUSE 13.1.
First, we must install rsnapshot program on OpenSUSE 13.1. Use this command to install rsnapshot on OpenSUSE 13.1
su
zypper in rsnapshot
Once installed, we can now configure the rsnapshot.conf. Use your favorite text editor to edit the file in /etc/rsnapshot.conf. Make sure you are using root privilege.
nano /etc/rsnapshot.conf
Here on this config file, we can specify the destination of the backup, specify the backup source and also we can set the backup intervals.
##SNAPSHOT ROOT DIRECTORY## aka backup destination
Find the following section on the config file and then change to your destination directory. This is the backup destination. If you are trying to store the backup to a remote folder (Samba or NFS), you can put the mounted folder here.
snapshot_root /.snapshots/
Change it to something like this
snapshot_root /backup/
I want to put my backup on the /backup folder.
Now, uncomment the following line to enable remote ssh backups over rsync.
cmd_ssh /path/to/ssh
Change it to
#cmd_ssh /path/to/ssh
##BACKUP INTERVAL##
Here you can set the interval of the backup. You can change the following section to set the backup interval.
interval hourly 6
interval daily 7
interval weekly 4
#interval monthly 3
For example, I just want to perform the backup on daily base, I change it to:
#interval hourly 6interval daily 7
#interval weekly 4
#interval monthly 3
#BACKUP POINT## or Backup sources
You can include several folders to the backup. Find the Backup Point section on the config file. Add your own backup point here
# LOCALHOST
backup /home/ localhost/
backup /etc/ localhost/backup /usr/local/ localhost/
#backup /var/log/rsnapshot localhost/
#backup /etc/passwd localhost/
#backup /home/foo/My Documents/ localhost/
#backup /foo/bar/ localhost/ one_fs=1, rsync_short_args=-urltvpog
#backup_script /usr/local/bin/backup_pgsql.sh localhost/postgres/
On this example, I want to add my own directory to the backup point so, I edit the default backup points to my own
# LOCALHOST
#backup /home/ localhost/
#backup /etc/ localhost/
#backup /usr/local/ localhost/
#backup /var/log/rsnapshot localhost/
#backup /etc/passwd localhost/
#backup /home/foo/My Documents/ localhost/
#backup /foo/bar/ localhost/ one_fs=1, rsync_short_args=-urltvpog
#backup_script /usr/local/bin/backup_pgsql.sh localhost/postgres/
#backup /share/ localhost/
OK done. Now we can test if the config file is correct. Execute this command on Terminal
rsnapshot configtest
It should returned
Syntax OK
If you got error, please read it and find where the error exist. Now you can execute the backup using command:
rsnapshot daily
Next, you can automate this process as well. I will describe how to automate rsnapshot backup next time.