← 返回命令列表

Linux command

borgbackup 命令

文本

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

常用示例

Initialize a new backup repository

borg init --encryption=repokey [/path/to/repo]

Create a backup

borg create [/path/to/repo]::[archive_name] [/path/to/source]

Create backup with compression and statistics

borg create --stats --compression lz4 [/path/to/repo]::[archive_name] [/path/to/source]

List archives in a repository

borg list [/path/to/repo]

List contents of an archive

borg list [/path/to/repo]::[archive_name]

Extract an archive

borg extract [/path/to/repo]::[archive_name]

Show repository info

borg info [/path/to/repo]

Delete old archives

borg prune --keep-daily=7 --keep-weekly=4 [/path/to/repo]

Mount archive as filesystem

borg mount [/path/to/repo]::[archive_name] [/mnt/point]

说明

Borg (BorgBackup) is a deduplicating backup program with compression and encryption. It efficiently stores multiple backups by identifying and reusing duplicate data blocks, dramatically reducing storage requirements for incremental backups. Key features include client-side encryption ensuring only you can read your data, efficient deduplication that stores each unique data chunk only once across all archives, and compression to further reduce storage needs. Borg can backup to local directories, remote hosts via SSH, or cloud storage through rclone. Archives can be mounted via FUSE for easy browsing and selective restoration. Retention policies automatically prune old archives.

参数

init
Initialize a new backup repository.
create
Create a new backup archive.
list
List repository contents or archive files.
extract
Extract files from an archive.
delete
Delete archives.
prune
Delete archives according to retention policy.
mount / umount
Mount/unmount archive as FUSE filesystem.
info
Show archive or repository information.
check
Verify repository consistency.
--encryption _mode_
Encryption mode: none, repokey, keyfile.
--compression _algo_
Compression: none, lz4, zstd, zlib, lzma.
--exclude _pattern_
Exclude files matching pattern.
--progress
Show progress during operations.
-v, --verbose
Increase output verbosity.
--stats
Print statistics about the created archive (file count, size, dedup ratio).
--list
Output a list of files as they are processed during create or extract.
--dry-run
Perform a trial run with no changes made (supported by create, prune, delete).
--remote-path _path_
Set the path to the borg executable on the remote host.

FAQ

What is the borgbackup command used for?

Borg (BorgBackup) is a deduplicating backup program with compression and encryption. It efficiently stores multiple backups by identifying and reusing duplicate data blocks, dramatically reducing storage requirements for incremental backups. Key features include client-side encryption ensuring only you can read your data, efficient deduplication that stores each unique data chunk only once across all archives, and compression to further reduce storage needs. Borg can backup to local directories, remote hosts via SSH, or cloud storage through rclone. Archives can be mounted via FUSE for easy browsing and selective restoration. Retention policies automatically prune old archives.

How do I run a basic borgbackup example?

Run `borg init --encryption=repokey [/path/to/repo]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does init do in borgbackup?

Initialize a new backup repository.