Skip to content

Instantly share code, notes, and snippets.

@ldvc
Last active August 12, 2017 09:07
Show Gist options
  • Save ldvc/4446f3fe2b039c4c2a16b998006560ff to your computer and use it in GitHub Desktop.
Save ldvc/4446f3fe2b039c4c2a16b998006560ff to your computer and use it in GitHub Desktop.

proc for borgbackup setup

Largely inspired from https://www.karolak.fr/blog/2017/05/05/monter-un-serveur-de-sauvegardes-avec-borgbackup/

Backup will be executed with root account (in order to access all files)

$ sudo su -

Mandatory libs for building

$ apt install python3 python3-dev libssl-dev openssl libacl1-dev libacl1 liblz4-dev liblz4-1 build-essential
$ ssh-keygen -t ed25519
$ cat ~/.ssh/id_ed25519.pub

venv stuff

$ mkdir -p ~/.virtualenvs/
$ virtualenv -p python3 ~/.virtualenvs/borg-env
$ source ~/.virtualenvs/borg-env/bin/activate
$ pip install pip -U
$ pip install borgbackup

repos dir MUST exists on remote server

$ borg init ssh://backup@server.example.com:4222/~/repos/$HOSTNAME

restore single folder from an archive

borg extract ssh://backup@server.example.com:4222/~/repos/$HOSTNAME::2017-08-12 etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment