$linuxjunkies
>

duplicity(1)

Duplicity backs up files encrypted and incremental to local or remote storage, supporting multiple backends.

UbuntuDebianFedoraArch

Synopsis

duplicity [OPTION]... [full|incremental|list-current-files|verify|remove-older-than|cleanup] [SOURCE] [DESTINATION]

Description

Duplicity is an encrypted bandwidth-efficient backup tool that uses tar and GnuPG to create full and incremental backups. It supports local filesystems, rsync, SSH/SCP, FTP, WebDAV, S3, Rackspace CloudFiles, and other remote backends.

Backups are stored as encrypted tar-format files with optional compression. Duplicity automatically manages full and incremental backup chains, allowing restoration from any point in time.

By default, duplicity creates an incremental backup. Use the full command to force a full backup, or incremental for an incremental backup.

Common options

FlagWhat it does
--full-if-older-than DAYSCreate full backup if the last full backup is older than specified days
--encrypt-key KEYIDEncrypt backup with specified GPG key ID
--sign-key KEYIDSign backup with specified GPG key ID for authenticity
-r DAYS, --restore-time DAYSRestore files from DAYS ago (backup is restored to a specific point in time)
--file-to-restore PATHRestore only the specified file or directory from the backup
--verbosity LEVELSet verbosity level: error, warning, notice, info, debug (default: notice)
--exclude PATTERNExclude files matching pattern from backup
--include PATTERNInclude files matching pattern in backup
--name BACKUP_NAMESet a unique name for this backup chain; useful for multiple backup sets
--asynchronous-uploadUpload volumes asynchronously for better performance
--no-compressionDisable compression; useful for already-compressed data
--archive-dir DIRECTORYStore metadata cache in specified directory (speeds up operations)

Examples

Create incremental backup of /home/user to S3 bucket; prompts for encryption passphrase

duplicity /home/user s3://my-bucket/backups

Create full encrypted backup via SFTP using GPG key 1A2B3C4D

duplicity full --encrypt-key 1A2B3C4D /home/user sftp://[email protected]/backups

Restore single file from 7 days ago to /tmp/restore directory

duplicity --file-to-restore documents/important.pdf -r 7D /home/user /tmp/restore

Verify backup integrity by comparing against source files

duplicity verify --archive-dir ~/.cache/duplicity s3://my-bucket/backups /home/user

List all files in the current backup set on S3

duplicity list-current-files s3://my-bucket/backups

Delete backup chains older than 90 days, keeping recent backups

duplicity remove-older-than 90D s3://my-bucket/backups

Backup to local disk while excluding temporary and cache files

duplicity --exclude '*.tmp' --exclude '/home/user/.cache' /home/user /mnt/backup-disk

Remove partial or broken backup files from S3 storage

duplicity cleanup --force s3://my-bucket/backups

Related commands