borg
Deduplicating backup with compression and encryption
TLDR
Initialize repository
$ borg init --encryption=[repokey] [/path/to/repo]
Create backupcopy
$ borg create [/path/to/repo::backup-{now}] [/path/to/data]
List archivescopy
$ borg list [/path/to/repo]
Extract backupcopy
$ borg extract [/path/to/repo::backup-name]
Check repositorycopy
$ borg check [/path/to/repo]
Prune old backupscopy
$ borg prune --keep-daily [7] --keep-weekly [4] [/path/to/repo]
Compact the repository to actually free pruned spacecopy
$ borg compact [/path/to/repo]
Mount an archive to browse it as a filesystemcopy
$ borg mount [/path/to/repo::backup-name] [/mnt/point]
copy
SYNOPSIS
borg command [options]
DESCRIPTION
borg (BorgBackup) is a deduplicating backup program with compression and authenticated encryption. It efficiently stores multiple backups by sharing common data blocks, making it ideal for frequent backups of large datasets.The tool provides security, efficiency, and reliability for local and remote backups.
PARAMETERS
init
Initialize repositorycreate
Create new archiveextract
Extract archive contentslist
List archives or contentsdiff
Compare archivesdelete
Delete archiveprune
Delete old archives by retention policycompact
Free repository space freed by prune or delete (run after pruning)info
Show archive/repository informationmount
Mount archive as filesystemcheck
Verify repository consistency
ENCRYPTION MODES
repokey
Key stored in repositorykeyfile
Key stored locallynone
No encryptionauthenticated
Authenticated only (no encryption)
WORKFLOW
$ # Initialize repository
borg init --encryption=repokey /backup/repo
# Create first backup
borg create /backup/repo::monday /home/user
# Create incremental backup (automatic deduplication)
borg create /backup/repo::tuesday /home/user
# List backups
borg list /backup/repo
# Restore
borg extract /backup/repo::monday
# Mount for browsing
borg mount /backup/repo::monday /mnt/backup
# Prune old backups
borg prune --keep-daily=7 --keep-weekly=4 /backup/repo
# Reclaim the space freed by prune
borg compact /backup/repo
borg init --encryption=repokey /backup/repo
# Create first backup
borg create /backup/repo::monday /home/user
# Create incremental backup (automatic deduplication)
borg create /backup/repo::tuesday /home/user
# List backups
borg list /backup/repo
# Restore
borg extract /backup/repo::monday
# Mount for browsing
borg mount /backup/repo::monday /mnt/backup
# Prune old backups
borg prune --keep-daily=7 --keep-weekly=4 /backup/repo
# Reclaim the space freed by prune
borg compact /backup/repo
copy
FEATURES
Deduplication
Chunk-level deduplication shares common data across archivesCompression
Supports lz4, zstd, zlib, and lzmaEncryption
Authenticated AES encryption with repokey or keyfile modesRemote backups
Push backups to a remote repository over SSHOther
Sparse file support, archive mounting via FUSE, data verification, and efficient storage
CAVEATS
Repository corruption can lose all backups (keep offsite copies). Encryption key loss means permanent data loss. Large repos need significant RAM for cache. SSH connection required for remote repos. Check operations can be slow.
HISTORY
BorgBackup was created by Thomas Waldmann in 2015 as a fork of Attic backup, focusing on performance, security, and reliability.