Add more functionality to your Fedora 24 server by installing rsnapshot. Rsnapshot is a powerful backup/snapshot utility based on rsync. This text based snapshot tool can perform and keep multiple fixed backups on your system. Rsnapshot is different from any traditional backup software. You can keep many snapshots without having to worry your space will run out soon.
If you are running Fedora 24 Server, follow these steps to get rsnapshot up and running on your server within minutes. First, we need to install rsnapshot. Log in to your Fedora 24 server and execute this command to install rsnapshot on Fedora 24.
dnf install rsnapshot
Configure rsnapshot
A. Backup Location
The rsnapshot configuration file is located in /etc/rsnapshot.conf. Inside this file you will find all the rsnapshot backup instruction and settings.
Configure the backup storage location
First, we need to configure where the backup snapshot will be saved. In the rsnapshot.conf file, locate the line below:
snapshot_root /.snapshots/
By default the snapshot will be saved under /.snapshots/ directory. Now change it to something like this
snapshot_root /backup/
Don’t forget the trailing slash (/) at the end of the line.
B. Backup Interval
To specify the backup interval, find the line that saying:
interval hourly 6
interval daily 7
interval weekly 4
Change the line to match your needs. For example, I just want to enable the backup on daily basis and disable the hourly and weekly.
#interval hourly 6
interval daily 7
#interval weekly 4
C. Backup Source
Next we need to specify the backup source. At the end of the config file, you will find some example for the backup sources.
# LOCALHOST
backup /home/ localhost/
backup /etc/ localhost/
backup /usr/local/ localhost/
#backup /var/log/rsnapshot localhost/
Simply delete the lines that you don’t want to include in the backup or put the # symbol at the beginning of the line. Or you can add your own sources as well. For example:
backup /var/samba/database/ /localhost/
backup /home/ localhost/
backup /etc/ localhost/
I think this is enough for a basic backup task. Rsnapshot is a highly configurable backup solution. For more information about this, you can visit the official documentation at: http://rsnapshot.org/rsnapshot/docs/docbook/rest.html#automation
D. Test the backup
Once we have configured rsnapshot, its better to give a test to it and see if it works. Execute this command to test your configuration file
rsnapshot configtest
It must produce a line “Syntax OK”. Otherwise, you will need to check the config file for any syntax errors.
I realize that this tutorial is still pretty basic and there are still many things we can do with rsnapshot. So, I think I will trying to update my tutorial with different cases, configuration and settings in the future.
Thanks for coming.