Borg

description: Backup Commandline tool

lang: ENG

Recurrent flags

Init a borg repository

# Generate a strong passphrase
openssl rand -base64 50 > "/path/to/passphrase"

# Export command to retrieve PASSPHRASE
export BORG_PASSCOMMAND="cat /path/to/passphrase"

# Init a borg repository in a specific location
borg init --encryption=repokey /path/to/borg/repo

Create an archive

# Export command to retrieve PASSPHRASE
export BORG_PASSCOMMAND="cat /path/to/passphrase"

borg create "/path/to/borg/repo"::backup_name [FILES TO BACKUP]

Prune archives

# Export command to retrieve PASSPHRASE
export BORG_PASSCOMMAND="cat /path/to/passphrase"

borg prune --keep-daily=7 --keep-monthly=4 "/path/to/borg/repo"

Compact data

# Export command to retrieve PASSPHRASE
export BORG_PASSCOMMAND="cat /path/to/passphrase"

borg compact "/path/to/borg/repo"

List archives

# Export command to retrieve PASSPHRASE
export BORG_PASSCOMMAND="cat /path/to/passphrase"

borg list "/path/to/borg/repo"

Extract archive

borg extract -v --list "/path/to/borg/repo"::backup_name [archive_repo_paths]

Delete archive

# Export command to retrieve PASSPHRASE
export BORG_PASSCOMMAND="cat /path/to/passphrase"

borg delete --list "/path/to/borg/repo"::backup_name