Backup with rdiff-backup

Let’s see how to do incremental automated backup for your files on Debian.

First, we will define a list of folders to backup and place it into a file, for example /root/folders.txt. In this example, we backup some folders from /home :

After installing rdiff-backup, we can backup these folders into /Data/Backup with:

The log will be available in /Data/Backup/rdiff-backup-data.

Automated backup

Our strategy is to backup once a week and remove backup older than a month. For that, let us create the complete backup script, for example in /root/

Finally, we will use anacron to run the script once a week. Contrary to crontab, it allows us to avoid running the computer 24hours a day and will run the backup the next time the computer will boot if needed.