← 返回命令列表

Linux command

duplicity 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Backup a directory

duplicity [/path/to/source] [sftp://user@host/backup]

Incremental backup

duplicity --full-if-older-than [30D] [/path/to/source] [file:///backup/destination]

Restore from backup

duplicity restore [sftp://user@host/backup] [/path/to/restore]

Restore specific file

duplicity restore --file-to-restore [relative/path/file] [backup_url] [/path/to/restore]

List files in backup

duplicity list-current-files [backup_url]

Verify backup

duplicity verify [backup_url] [/path/to/source]

Remove old backups

duplicity remove-older-than [60D] [backup_url]

Encrypt with GPG key

duplicity --encrypt-key [KEY_ID] [/source] [destination]

说明

duplicity is a backup tool that creates encrypted, bandwidth-efficient backups. It uses librsync to produce incremental archives that only contain changed parts of files, and GnuPG for encryption and signing. Backups can be stored locally or on various remote backends including SFTP, S3, Google Cloud Storage, Azure, WebDAV, and many others. The combination of encryption and incremental transfers makes duplicity suitable for remote/cloud backups over untrusted networks. A full backup is periodically created, with subsequent incremental backups storing only changes. This allows point-in-time recovery while minimizing storage and bandwidth usage.

参数

full
Force a full backup.
incremental
Force incremental backup.
restore
Restore from backup.
verify
Verify backup integrity.
list-current-files
List files in current backup.
remove-older-than _time_
Delete old backup sets.
remove-all-but-n-full _n_
Keep only n full backups.
--full-if-older-than _time_
Full backup if last one is older than time.
--encrypt-key _key_id_
GPG key for encryption.
--sign-key _key_id_
GPG key for signing.
--no-encryption
Disable encryption entirely.
--include _pattern_
Include files matching pattern.
--exclude _pattern_
Exclude files matching pattern.
--file-to-restore _path_
Restore specific file.
-t _time_, --restore-time _time_
Restore from specific time.
--tempdir _path_
Use specific directory for temporary files.
--progress
Display upload progress and estimated upload time.
--verbosity _level_
Set verbosity level (0-9, default 3).

FAQ

What is the duplicity command used for?

duplicity is a backup tool that creates encrypted, bandwidth-efficient backups. It uses librsync to produce incremental archives that only contain changed parts of files, and GnuPG for encryption and signing. Backups can be stored locally or on various remote backends including SFTP, S3, Google Cloud Storage, Azure, WebDAV, and many others. The combination of encryption and incremental transfers makes duplicity suitable for remote/cloud backups over untrusted networks. A full backup is periodically created, with subsequent incremental backups storing only changes. This allows point-in-time recovery while minimizing storage and bandwidth usage.

How do I run a basic duplicity example?

Run `duplicity [/path/to/source] [sftp://user@host/backup]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does full do in duplicity?

Force a full backup.