

Backing up data regularly is crucial to avoid data loss due to system failures. rsnapshot, a wrapper around the rsync tool, simplifies incremental backups of local and remote file systems, using hard links to save disk space.
Prerequisites
To install rsnapshot on Ubuntu, run the following command:
sudo apt-get install rsnapshot -y
On Fedora-based distributions, use:
sudo dnf install rsnapshot -y
For Arch Linux users:
sudo pacman -S rsnapshot
Make sure rsync is installed as well. You can install it with:
# For Ubuntu:
sudo apt-get install rsync -y
# For Fedora:
sudo dnf install rsync -y
# For Arch:
sudo pacman -S rsync
Open the rsnapshot configuration file to begin the setup:
sudo nano /etc/rsnapshot.conf
Update the snapshot directory by modifying the snapshot_root line:
snapshot_root /backup
This assumes your backups will be stored in the /backup directory. If you want to store backups on an external drive, make sure it is mounted there. Additionally, disable root directory creation by uncommenting the following line:
no_create_root 1
Also, ensure the correct path to the rsync binary is set:
cmd_rsync /usr/bin/rsync
In the BACKUP LEVELS / INTERVALS section, define how many backups to keep:
retain alpha 6
retain beta 7
retain gamma 4
You can replace alpha, beta, and gamma with more meaningful names like daily, weekly, and monthly for clarity.
Configure the directories to be backed up under the #LOCALHOST section:
backup /home/ localhost/
backup /etc/ localhost/
backup /usr/local/ localhost/
These paths can be customized based on your needs. Keep the localhost/ identifier unchanged, as it signifies the local system.
Before launching your first backup, it’s essential to verify the configuration by running:
sudo rsnapshot configtest
If everything checks out, you’re ready to use rsnapshot to automate and safeguard your system backups.
By setting up rsnapshot on Ubuntu Server 22.04, you can efficiently manage incremental backups while minimizing disk space usage. Regular backups are critical, and with rsnapshot, the process becomes streamlined and reliable.
You can download new version of ubuntu from —–Download Ubuntu 24.10
Click below and ‘share’ this article!
select one of our plans and start building the most wanted app/website available today. We make sure every aspect of the server maintenance are handled with a level of expertise needed for growing your business!
Copyright 2024 techprovidence