Duplicity

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 any of the following protocols: rsync, ftp, HSI, WebDAV, Tahoe-LAFS, or Amazon S3.

Duplicity is a network backup program.

Backups are granularly incremental, meaning that only changes in files (since the last snapshot) are stored.

Installation

Install the duplicity package.

Front-ends

  • Duply A shell front end for duplicity. It manages backup job settings in profiles and allows to batch execute commands.
https://duply.net/Main_Page || duplyAUR
  • Deja Dup Simple backup tool, that hides the complexity of backing up the Right Way and uses duplicity as the backend.
https://wiki.gnome.org/Apps/DejaDup || deja-dup

Basic Usage

Doing backups

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://uid@other.host//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://uid@other.host//usr/backup /home/me 

Note the reversed ordering of 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 would need to be explicitly specified using the 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 for details.

Example backup script

Note: There is an issue with the current version of pinentry (0.8.1-3) that will not allow passphrase entry for a root gpg-agent when logged in as root using su - or sudo. If you are accessing a remote server where direct root ssh login is not allowed (or desired!), then you have to either patch pinentry or chown root `tty` before running pinentry. This is not an issue when running gpg-agent as a non-root user.

If you want to start gpg-agent on root login and then cache the passphrases for gpg-agent at your convenience, you can add these functions to your :

Troubleshooting

If you get gpg errors revolving around “inappropriate ioctl for device” it most likely has to do with changes to the gpg agent behavior from gpg version 2.1 up. See this thread for more information. Generally speaking one needs to explicitly allow programs to provide the passphrase to gpg agent instead of prompting the user.

The steps to remediate this issue are outlined in GnuPG#Unattended passphrase.

gollark: I don't know if I would call that actual coercion or power, hµ.
gollark: How is that a position of *power*?
gollark: LyricLy make macarons and macrons simultaneously.
gollark: It's probably stupid and should be ignored.
gollark: I believe* you.

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.