Skip to content

rdiff-backup/rdiff-backup

Repository files navigation

rdiff-backup

rdiff-backup is a simple backup tool which can be used locally and remotely, on Linux and Windows, and even cross-platform between both. Users have reported using it successfully on FreeBSD and MacOS X.

Beside its ease of use, one of the main advantages of rdiff-backup is that it does use the same efficient protocol as rsync to transfer and store data. Because rdiff-backup only stores the differences from the previous backup to the next one (a so called reverse incremental backup), the latest backup is always a full backup, making it easiest and fastest to restore the most recent backups, combining the space advantages of incremental backups while keeping the speed advantages of full backups (at least for recent ones).

If the optional dependencies pylibacl and pyxattr are installed, rdiff-backup will support Access Control Lists and Extended Attributes provided the file system(s) also support these features.

1. INSTALLATION

In older Linux distributions the rdiff-backup versions are of the 1.x series, which is not recommended for new installs anymore. Follow the instructions below to install the latest 2.x release of rdiff-backup.

Caution
rdiff-backup 1.x and 2.x aren’t compatible and can’t be mixed in server/client mode! See how to migrate side-by-side.

1.1. Ubuntu Focal or Debian Bullseye or newer (has 2.0)

sudo apt install rdiff-backup

1.2. Ubuntu backports for older versions (needs a backported 2.0)

sudo apt install software-properties-common
sudo add-apt-repository ppa:rdiff-backup/rdiff-backup-backports
sudo apt update
sudo apt install rdiff-backup

1.3. RHEL 7 and its replicas (from EPEL)

sudo yum install epel-release
sudo yum install rdiff-backup
sudo yum install py3libacl pyxattr
Note
the last line is optional to get ACLs and EAs support.

1.4. RHEL 8 and its replicas (from EPEL)

sudo dnf install epel-release
sudo dnf --enablerepo=PowerTools install rdiff-backup
Note
you can add the option --setopt=install_weak_deps=False to the last line if you don’t need ACLs and EAs support. You can install python3-pylibacl and python3-pyxattr also separately. Under RHEL, the repo to enable is codeready-builder-for-rhel-8-x86_64-rpms in order to get access to pyxattr, instead of PowerTools.
Note
This does not enable updates for PowerTools, check the distribution documentation for details on how to do this.

1.5. Fedora 34+

sudo dnf install rdiff-backup
Note
for earlier versions, see the COPR instructions below.

1.6. Debian and derivatives, Raspbian, etc. (from PyPi)

sudo apt install python3-pip python3-setuptools python3-pylibacl python3-pyxattr
sudo pip3 install rdiff-backup
Note
If your platform is not i386 or amd64, e.g. ARM/MIPS/etc, you may need the build dependencies build-essentials, librsync-dev.

1.7. CentOS and RHEL 6 (from PyPi)

sudo yum install centos-release-scl
sudo yum install rh-python36 gcc libacl-devel
scl enable rh-python36 bash
sudo pip install rdiff-backup pyxattr pylibacl  # or rdiff-backup[meta]
echo 'exec scl enable rh-python36 -- rdiff-backup "$@"' | sudo tee /usr/bin/rdiff-backup
sudo chmod +x /usr/bin/rdiff-backup

1.8. Fedora and derivatives (from PyPI)

sudo dnf install python3-pip python3-setuptools py3libacl python3-pyxattr
sudo pip3 install rdiff-backup

1.9. Other Linux and UN*X-oid systems, e.g. BSD (from PyPi)

You need to make sure that the following requirements are met, using your system’s package/software/application manager, searching there for the following keywords:

  • Python, 3.9 or higher

  • Python pip or pip3, e.g. with python -m ensurepip --upgrade

  • librsync or librsync2, 2.0.0 or higher

  • libacl or libacl1 or simply acl (optional, to support ACLs)

  • SSH, generally OpenSSH, client and/or server (optional, for remote operations)

Then you should only need to call one of the following before you can use rdiff-backup:

sudo pip3 install rdiff-backup        # without optional dependencies
sudo pip3 install rdiff-backup[meta]  # with support for metadata, ACLs and EAs
Note
especially if your platform is not i386 or amd64, e.g. ARM/MIPS/PowerPC/etc, but also if the pip3 installation fails with #include […​].h files missing, you may need the build dependencies named like python3-devel, librsync-dev or libacl1-dev.

1.10. Windows

Just download and unpack the file rdiff-backup-VERSION.win64exe.zip (or win32 if need be). It is available as asset attached to one of the releases available in the releases section. Then drop the binary rdiff-backup.exe somewhere in your PATH and it should work, as it comes with all dependencies included.

Note
starting with rdiff-backup 2.1.1 embedding Python 3.10, rdiff-backup cannot be used on Windows 7 or earlier.

Another way to install rdiff-backup is to use Chocolatey and call choco install rdiff-backup.

For remote operations, you will need to have an SSH package installed. The standard one provided by Microsoft is probably your safest choice, else we recommend using OpenSSH from mls-software.com.

2. BASIC USAGE

Creating your first backup is as easy as calling rdiff-backup <source-dir> <backup-dir> (possibly as root), e.g. rdiff-backup -v5 /home/myuser /run/media/myuser/MYUSBDRIVE/homebackup would save your whole home directory (under Linux) to a USB drive (which you should have formatted with a POSIX file system, e.g. ext4 or xfs). Without the -v5 (v for verbosity), rdiff-backup isn’t very talkative, hence the recommendation.

Subsequent backups can simply be done by calling exactly the same command, again and again. Only the differences will be saved to the backup directory.

If you need to restore the latest version of a file you lost, it can be as simple as copying it back using normal operating system means (cp or copy, or even pointing your file browser at the backup directory). E.g. taking the above example cp -i /run/media/myuser/MYUSBDRIVE/homebackup/mydir/myfile /home/myuser/mydir/myfile and the lost file is back!

There are many more ways to use and tweak rdiff-backup, they’re documented in the man pages, in the documentation directory, or on our website.

3. TROUBLESHOOTING

If you have everything installed properly, and it still doesn’t work, see the enclosed FAQ, the rdiff-backup web page and/or the rdiff-backup-users mailing list.

We’re also happy to help if you create an issue to our GitHub repo. The most important is probably to explain what happened with which version of rdiff-backup, with which command parameters on which operating system version, and attach the output of rdiff-backup run with the very verbose option -v9.

The FAQ in particular is an important reference, especially if you are using smbfs/CIFS, Windows, or have compiled by hand on Mac OS X.

4. CONTRIBUTING

Rdiff-backup is an open source software developed by many people over a long period of time. There is no particular company backing the development of rdiff-backup, so we rely very much on individual contributors who "scratch their itch". All contributions are welcome!

There are many ways to contribute:

  • Testing, troubleshooting and writing good bug reports that are easy for other developers to read and act upon

  • Reviewing and triaging existing bug reports and issues, helping other developers focus their efforts

  • Writing documentation (e.g. the man page), or updating the webpage rdiff-backup.net

  • Packaging and shipping rdiff-backup in your own favorite Linux distribution or operating system

  • Running tests on your favorite platforms and fixing failing tests

  • Writing new tests to get test coverage up

  • Fixing bug in existing features or adding new features

If you don’t have anything particular in your mind but want to help out, just browse the list of issues. Both coding and non-coding tasks have been filed as issues.

For source code related documentation see docs/DEVELOP.adoc

4.1. Installing latest development release

To provide meaningful bug reports and help with testing, please use the latest development release.

4.1.1. Ubuntu and Debian development releases

sudo add-apt-repository ppa:rdiff-backup/rdiff-backup-development
sudo apt update
sudo apt install rdiff-backup

4.1.2. Fedora, CentOS and RHEL (from COPR)

On CentOS and RHEL (7 and 8):

sudo yum install dnf-plugins-core epel-release
sudo yum copr enable frankcrawford/rdiff-backup
sudo yum install rdiff-backup

On Fedora 30+:

sudo dnf install dnf-plugins-core
sudo dnf copr enable frankcrawford/rdiff-backup
sudo dnf install rdiff-backup

4.1.3. PyPi pre-releases

sudo pip3 install rdiff-backup --pre

5. Packaging status in distros

Packaging status