BorgBackup utility

Written on November 17, 2017

This is a small quick start guide for BorgBackup. The main goal of Borg is to provide an efficient and secure way to backup data.

Installation

Full guide can be found here

Package Installation

  • macOS - brew install borgbackup
  • Arch Linux - pacman -S borg
  • Debian & Ubuntu - apt-get install borgbackup

Standalone Binary Package

Binary Release page

Add the binary to a folder in your PATH

sudo cp borg-linux64 /usr/local/bin/borg
sudo chown root:root /usr/local/bin/borg
sudo chmod 755 /usr/local/bin/borg

If a new version of Borg is released, the binary will need to be downloaded again and reinstalled.

Using Git

# get borg from github
git clone https://github.com/borgbackup/borg.git
    
virtualenv --python=python3 borg-env
source borg-env/bin/activate   # always before using!
    
# install borg + dependencies into virtualenv
pip install sphinx  # optional, to build the docs
cd borg
pip install -r requirements.d/development.txt
pip install -r requirements.d/fuse.txt  # optional, for FUSE support
pip install -e .  # in-place editable mode
    
# optional: run all the tests, on all supported Python versions
# requires fakeroot, available through your package manager
fakeroot -u tox

Quick Start guide

  1. Initialize the backup repo: borg init --encryption=repokey /path/to/repo
  2. Create the first archive: borg create /path/to/repo::Monday ~/src ~/Documents
  3. Create another archive: borg create --stats /path/to/repo::Tuesday ~/src ~/Documents
  4. List archives: borg list /path/to/repo
  5. List contents of a specific archive: borg list /path/to/repo::Monday
  6. Restore an archive: borg extract /path/to/repo::Monday
  7. Delete archive: borg delete /path/to/repo::Monday
  8. Recover disk space: borg compact /path/to/repo

Full quick start guide