LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

bup

Git-based backup system with deduplication

TLDR

Initialize a bup repository in the default location (~/.bup)
$ bup init
copy
Initialize a repository in a custom directory
$ BUP_DIR=[/path/to/repo] bup init
copy
Index files for backup
$ bup index [/path/to/backup]
copy
Save an indexed backup with a name
$ bup save -n [backup-name] [/path/to/backup]
copy
List all backups
$ bup ls
copy
List files in a specific backup
$ bup ls [backup-name]/latest/
copy
Restore files to a target directory
$ bup restore -C [/restore/path] [backup-name/latest/path]
copy
Check repository integrity
$ bup fsck
copy

SYNOPSIS

bup command [options]

DESCRIPTION

bup is a backup system based on git's packfile format. It provides very efficient storage through deduplication, splitting large files into chunks, and using rolling checksums to find duplicate data.The tool is particularly effective for backing up large files with small changes.

PARAMETERS

init

Initialize bup repository. Uses ~/.bup by default or BUP_DIR if set.
index path
Index files for backup. Must be run before save.
save -n name path
Save indexed files as a named backup set.
restore -C target backup-path
Restore files from a backup to the target directory.
ls [backup]
List backups or files within a backup.
fsck
Check repository integrity.
fuse mountpoint
Mount backups as a read-only FUSE filesystem.
damage
Deliberately damage a repository for testing fsck.
margin
Report the maximum number of matching prefix bits between objects.
midx
Create or display midx (multi-index) files.
memtest
Test memory throughput.
web
Start a web server to browse backups.

ENVIRONMENT

BUP_DIR

Path to the bup repository. Defaults to ~/.bup.
BUP_FORCE_TTY
Force progress output even when not on a terminal.

WORKFLOW

$ # Initialize (in ~/.bup by default)
export BUP_DIR=/backup/bup-repo
bup init

# Index files
bup index ~/Documents

# Save backup
bup save -n documents ~/Documents

# List backups
bup ls

# List files in backup
bup ls documents/latest/

# Restore
bup restore -C ~/restored documents/latest/

# Mount as filesystem
mkdir /mnt/bup
bup fuse /mnt/bup

# Remote backup over SSH
bup init -r myserver:
bup save -r myserver: -n documents ~/Documents
copy

DEDUPLICATION

Uses rolling checksums to identify duplicate chunks even when shifted within files. Very efficient for:- Virtual machine images- Large archives- Database backups- Version control repositories

CAVEATS

Not encrypted by default. Repository can grow large without maintenance. Restore can be slow for many small files. Less mature than borg/restic. Documentation sometimes lacking. Not ideal for many tiny files. No built-in pruning of old backups.

HISTORY

bup was created by Avery Pennarun around 2010 to provide git-like backup with efficient deduplication for large files.

SEE ALSO

borg(1), restic(1), git(1), rsync(1), tar(1)

Copied to clipboard
Kai