SysTutorials

Linux Manual Pages › Section 1

rdiff-backup(1)

NAME

rdiff-backup – local/remote mirror and incremental backup

SYNOPSIS

rdiff-backup [options] [[[user@]host1.foo]::source_directory] [[[user@]host2.foo]::destination_directory]

rdiff-backup {{ -l | –list-increments } | –remove-older-than time_interval | –list-at-time time | –list-changed-since time | –list-increment-sizes | –verify | –verify-at-time time} [[[user@]host2.foo]::destination_directory]

rdiff-backup –calculate-average statfile1 statfile2 …

rdiff-backup –test-server [user1]@host1.net1::path [[user2]@host2.net2::path] …

DESCRIPTION

rdiff-backup is a script, written in python(1) that backs up one directory to another. The target directory ends up a copy (mirror) of the source directory, but extra reverse diffs are stored in a special subdirectory of that target directory, so you can still recover files lost some time ago. The idea is to combine the best features of a mirror and an incremental backup. rdiff-backup also preserves symlinks, special files, hardlinks, permissions, uid/gid ownership, and modification times.

rdiff-backup can also operate in a bandwidth efficient manner over a pipe, like rsync(1). Thus you can use ssh and rdiff-backup to securely back a hard drive up to a remote location, and only the differences will be transmitted. Using the default settings, rdiff-backup requires that the remote system accept ssh connections, and that rdiff-backup is installed in the user’s PATH on the remote system. For information on other options, see the section on REMOTE OPERATION.

Note that you should not write to the mirror directory except with rdiff-backup. Many of the increments are stored as reverse diffs, so if you delete or modify a file, you may lose the ability to restore previous versions of that file.

Finally, this man page is intended more as a precise description of the behavior and syntax of rdiff-backup. New users may want to check out the examples.html file included in the rdiff-backup distribution.

OPTIONS

-b, –backup-mode
Force backup mode even if first argument appears to be an increment or mirror file.
–calculate-average
Enter calculate average mode. The arguments should be a number of statistics files. rdiff-backup will print the average of the listed statistics files and exit.
–carbonfile
Enable backup of MacOS X carbonfile information.
–check-destination-dir
If an rdiff-backup session fails, running rdiff-backup with this option on the destination dir will undo the failed directory. This happens automatically if you attempt to back up to a directory and the last backup failed.
–compare
This is equivalent to ‘–compare-at-time now‘
–compare-at-time time
Compare a directory with the backup set at the given time. This can be useful to see how archived data differs from current data, or to check that a backup is current. This only compares metadata, in the same way rdiff-backup decides whether a file has changed.
–compare-full
This is equivalent to ‘–compare-full-at-time now‘
–compare-full-at-time time
Compare a directory with the backup set at the given time. To compare regular files, the repository data will be copied in its entirety to the source side and compared byte by byte. This is the slowest but most complete compare option.
–compare-hash
This is equivalent to ‘–compare-hash-at-time now‘
–compare-hash-at-time time
Compare a directory with the backup set at the given time. Regular files will be compared by computing their SHA1 digest on the source side and comparing it to the digest recorded in the metadata.
–create-full-path
Normally only the final directory of the destination path will be created if it does not exist. With this option, all missing directories on the destination path will be created. Use this option with care: if there is a typo in the remote path, the remote filesystem could fill up very quickly (by creating a duplicate backup tree). For this reason this option is primarily aimed at scripts which automate backups.
–current-time seconds
This option is useful mainly for testing. If set, rdiff-backup will use it for the current time instead of consulting the clock. The argument is the number of seconds since the epoch.
–exclude shell_pattern
Exclude the file or files matched by shell_pattern. If a directory is matched, then files under that directory will also be matched. See the FILE SELECTION section for more information.
–exclude-device-files
Exclude all device files. This can be useful for security/permissions reasons or if rdiff-backup is not handling device files correctly.
–exclude-fifos
Exclude all fifo files.
–exclude-filelist filename
Excludes the files listed in filename. If filename is handwritten you probably want –exclude-globbing-filelist instead. See the FILE SELECTION section for more information.
–exclude-filelist-stdin
Like –exclude-filelist, but the list of files will be read from standard input. See the FILE SELECTION section for more information.
–exclude-globbing-filelist filename
Like –exclude-filelist but each line of the filelist will be interpreted according to the same rules as –include and –exclude.
–exclude-globbing-filelist-stdin
Like –exclude-globbing-filelist, but the list of files will be read from standard input.
–exclude-other-filesystems
Exclude files on file systems (identified by device number) other than the file system the root of the source directory is on.
–exclude-regexp regexp
Exclude files matching the given regexp. Unlike the –exclude option, this option does not match files in a directory it matches. See the FILE SELECTION section for more information.
–exclude-special-files
Exclude all device files, fifo files, socket files, and symbolic links.
–exclude-sockets
Exclude all socket files.
–exclude-symbolic-links
Exclude all symbolic links. This option is automatically enabled if the backup source is running on native Windows to avoid backing-up NTFS reparse points.
–exclude-if-present filename
Exclude directories if filename is present. This option needs to come before any other include or exclude options.
–force
Authorize a more drastic modification of a directory than usual (for instance, when overwriting of a destination path, or when removing multiple sessions with –remove-older-than). rdiff-backup will generally tell you if it needs this. WARNING: You can cause data loss if you mis-use this option. Furthermore, do NOT use this option when doing a restore, as it will DELETE FILES, unless you absolutely know what you are doing.
–group-mapping-file filename
Map group names and ids according the the group mapping file filename. See the USERS AND GROUPS section for more information.
–include shell_pattern
Similar to –exclude but include matched files instead. Unlike –exclude, this option will also match parent directories of matched files (although not necessarily their contents). See the FILE SELECTION section for more information.
–include-filelist filename
Like –exclude-filelist, but include the listed files instead. If filename is handwritten you probably want –include-globbing-filelist instead. See the FILE SELECTION section for more information.
–include-filelist-stdin
Like –include-filelist, but read the list of included files from standard input.
–include-globbing-filelist filename
Like –include-filelist but each line of the filelist will be interpreted according to the same rules as –include and –exclude.
–include-globbing-filelist-stdin
Like –include-globbing-filelist, but the list of files will be read from standard input.
–include-regexp regexp
Include files matching the regular expression regexp. Only files explicitly matched by regexp will be included by this option. See the FILE SELECTION section for more information.
–include-special-files
Include all device files, fifo files, socket files, and symbolic links.
–include-symbolic-links
Include all symbolic links.
–list-at-time time
List the files in the archive that were present at the given time. If a directory in the archive is specified, list only the files under that directory.
–list-changed-since time
List the files that have changed in the destination directory since the given time. See TIME FORMATS for the format of time. If a directory in the archive is specified, list only the files under that directory. This option does not read the source directory; it is used to compare the contents of two different rdiff-backup sessions.
-l, –list-increments
List the number and date of partial incremental backups contained in the specified destination directory. No backup or restore will take place if this option is given.
–list-increment-sizes
List the total size of all the increment and mirror files by time. This may be helpful in deciding how many increments to keep, and when to –remove-older-than. Specifying a subdirectory is allowable; then only the sizes of the mirror and increments pertaining to that subdirectory will be listed.
–max-file-size size
Exclude files that are larger than the given size in bytes
–min-file-size size
Exclude files that are smaller than the given size in bytes
–never-drop-acls
Exit with error instead of dropping acls or acl entries. Normally this may happen (with a warning) because the destination does not support them or because the relevant user/group names do not exist on the destination side.
–no-acls
No Access Control Lists – disable backup of ACLs
–no-carbonfile
Disable backup of MacOS X carbonfile information
–no-compare-inode
This option prevents rdiff-backup from flagging a hardlinked file as changed when its device number and/or inode changes. This option is useful in situations where the source filesystem lacks persistent device and/or inode numbering. For example, network filesystems may have mount-to-mount differences in their device number (but possibly stable inode numbers); USB/1394 devices may come up at different device numbers each remount (but would generally have same inode number); and there are filesystems which don’t even have the same inode numbers from use to use. Without the option rdiff-backup may generate unnecessary numbers of tiny diff files.
–no-compression
Disable the default gzip compression of most of the .snapshot and .diff increment files stored in the rdiff-backup-data directory. A backup volume can contain compressed and uncompressed increments, so using this option inconsistently is fine.
–no-compression-regexp regexp
Do not compress increments based on files whose filenames match regexp. The default includes many common audiovisual and archive files, and may be found in Globals.py.
–no-eas
No Extended Attributes support – disable backup of EAs.
–no-file-statistics
This will disable writing to the file_statistics file in the rdiff-backup-data directory. rdiff-backup will run slightly quicker and take up a bit less space.
–no-hard-links
Don’t replicate hard links on destination side. If many hard-linked files are present, this option can drastically decrease memory usage. This option is enabled by default if the backup source or restore destination is running on native Windows.
–null-separator
Use nulls (