rdiff-backup

from Wikipedia, the free encyclopedia
rdiff-backup
Basic data

Maintainer Eric Zolf
Edward Ned Harvey
Ben Escoto
Current  version 2.0.0
(March 2020)
operating system Linux , macOS , Windows (via Cygwin )
programming language Python 2.x (from rdiff-backup 1.9 Python 3)
category data backup
License GPLv2
rdiff-backup.net

rdiff-backup is data backup software developed for Linux that can be used to create incremental backups.

particularities

The special feature of rdiff-backup is that new or changed files are entered into the full backup, while older and deleted file versions are saved as increments (so-called "reverse deltas"). With rdiff-backup, the full backup is accessible at any time as a normal directory - the restoration of the data that was last saved can be done by a simple copying process - by hand, or using cp or rsync . Earlier file versions or data stocks have to be restored yourself using rdiff-backup.

In contrast to this, with normal incremental backups that use “forward deltas”, the current data stock must be reconstructed using increment files, and only the data stock that was available during the last full backup can be easily restored.

rdiff-backup also supports backups on network servers. To recognize new files or new file versions, rdiff-backup uses the file name, the file type, the file size, the modification time (mtime) and the file permissions . A checksum like SHA-1 is not used. For this reason, rdiff-backup cannot back up any TrueCrypt container files, since the file size and modification time are not changed in order to better hide the file. rdiff-backup uses the rdiff (or rsync ) algorithm to recognize the changed parts of files and to store the difference as an increment file.

Overview of the increment files

In the backup directory (/ rdiff-backup-data / increments) you will find the following file extensions for the increments - "Date" corresponds to the time, and "gz" stands for a file compressed with gzip :

  • .Datum.missing for a file or directory that did not yet exist at the time of the backup. This is an empty file with a size of 0 bytes.
  • .Date.diff.gz for a file that has changed since the last backup.
  • .Date.snapshot.gz for a file that has been deleted or moved since the last backup. This can be used straight away to restore the file (see below).
  • .Date.dir for a directory whose content has changed since the last backup.

rdiff-backup-fs

With a tool called rdiff-backup-fs it is possible to mount the entire backup as a drive . Either a certain number of directories then appear that correspond to the source directories at that time at the respective increment times - but with an option you can also mount the backup in such a way that the current full backup is displayed - but with all the file versions as they are for each Increment time existed. In this way the user can - as with rsnapshot - access "snapshots" of the database directly.

Application examples

Backup

The backup is simply rdiff-backup -v N --print-statistics Quellverzeichnis Backupverzeichniscarried out using . Depending on the sudosituation, you have to put in front so that files are also copied for which the registered user has no access rights. -v Nand --print-statisticsprovide additional information about the backup process and can be omitted. Nis a number from 0 to 9.

rdiff-backup --exclude AusgeschlossenesVerzeichnis Quellverzeichnis Backupverzeichnis excludes a specific directory from the backups. This can be useful for the browser cache , for example .

The backup can be --no-fsyncmassively accelerated by rdiff-backup writing the data to the backup medium without delay, but the risk of data loss is higher.

The problem of files whose size and processing date remain the same despite a change in content can be circumvented as follows: rdiff-backup --compare-full Quellverzeichnis Backupverzeichniscompares the files in the source directory and backup bit by bit, or rdiff-backup --compare-hash Quellverzeichnis Backupverzeichniscompares the files using SHA-1 checksums. A backup does not take place. In the source directory, the modification time of the files concerned can then be set touchto the current time, and the file is then recorded by the next backup.

Removal of old backups

rdiff-backup can only delete the oldest increments of the backed up directory. This is done with rdiff-backup --remove-older-than X Backupverzeichnis, where X is either a date (e.g. 2014-12-12), a time span such as 5D (for "five days") or 1M (for "one month"), or the number of the backup ( --remove-older-than 10Bleaves the 10 most recent backups).

So far it is not possible to only delete specific files / directories and their saved earlier versions from the backup. Such a function was announced for version 2.2 of rdiff-backup.

Restoration

Any saved directories and files can be restored with rdiff-backup -r Zeit Backup Ziel. "Time" is, for example, "now" or a time, date or version information (similar to removing old backups, see above). It is even easier to use for restoring the last backup status rsync -a --delete Backup Zielor cp -a --remove-destination Backup Ziel. The user rights are only correctly restored if rdiff-backup was running on the computer to which the backup medium was connected (e.g. external hard drive on the private computer, see Backup over the network, where rdiff-backup was on a external computer is running).

An old file or an older directory can be restored in a targeted, yet relatively easy way if you find /rdiff-backup-data/incrementsthe corresponding increment file in the directory of the backup directory:

rdiff-backup Inkrementdatei Zielverzeichnis
rdiff-backup Inkrementdatei Zieldatei

This works with all increment files - except for those with the file extension ".missing". This increment file only indicates that a file or directory did not exist at the specified time.

Restoring a deleted file is even easier: To do this, you have to locate the increment file with the file extension ".snapshot.gz", copy it to the desired directory, unzip it with gzip, and adjust the file name (for example, "Lebenslauf.doc.2014 -10-10T09: 23: 50 + 02: 00.snapshot "to" CV.doc ").

statistics

rdiff-backup-statistics Backupverzeichnis provides various statistics, such as the listing of the directories that have changed the most over all backups.

rdiff-backup -l Backupverzeichnisshows the date of the full backup as well as the increments. For the (cumulative) file sizes of the various increments one can finally rdiff-backup --list-increment-sizes Backupverzeichnisuse.

See also

Web links

Individual evidence

  1. http://manpages.ubuntu.com/manpages/trusty/en/man1/archfs.1.html (accessed October 9, 2014)
  2. Patrik Dufresne: New Feature - File or Folder deletion from a repository. April 7, 2020, accessed April 8, 2020 .