Duplicity is a network backup program.
It can save snapshots of directories and files to a remote GnuPG encrypted tar file, which acts as a backup repository. Connecting with the remote backup repository can take place through one of the rsync, ftp, HSI, WebDAV, Tahoe-LAFS, or Amazon S3 protocols.
Backups are granularly incremental, meaning that only changes in files (since the last snapshot) are stored.
pacman -S duplicity
AUR.AUR, a shell frontend, is available in
To backup the local folder /home/me to the remote location /usr/backup on host other.host through the scp/ssh protocol, use:
duplicity /home/me scp://firstname.lastname@example.org//usr/backup
The first time this command is run, it will create a full backup. Running the exact same command again causes an incremental backup to the existing backup repository.
Additional command-line options options allow to:
- include or exclude specific files and directories from the backup (using shell patterns or regular expressions)
- fine-tune encryption and signing of the backups
Restoring files from backup
To restore the local folder /home/me to the state of the last snapshot saved in the remote repository /usr/backup on host other.host, do:
duplicity scp://email@example.com//usr/backup /home/me
Note the reversed ordering or the arguments compared to the backup command above. The URL argument is always treated as the backup repository, and the local path argument as the directory to sync with the backup. (A local backup repository needs to be explicitly specify using the file:// protocol prefix!)
Additional command-line option exist to allow:
- restore a specific file instead of the whole repository
- restore file(s) to the state they had on a specific date, rather than to the most recent available snapshot
Repository inspection and house-keeping
Some additional command-line options exist for comparing the repository state to the state of the local files, and to delete old snapshots so as to only keep a fixed amount of snapshots or only ones that are newer than a given date.
See the man page for details.
- Similar to Duplicity in that it also stores granularly incremental backups in a remote repository, but rather than uploading encrypted tar archives over arbitrary network protocols it creates a plain file mirror on the remote system using a custom protocol on top of ssh, similarly to how Rsync works.