Borg Backup

Menu

I recently replaced Time Machine with Borg on a Mac and these are the main steps to make it work.

The backup is on a server reached with ssh (and this is also the main reason for the switch, since Time Machine does not seem to work anymore with ssh; at least it stopped working on my machine).

Instructions

  1. Download borg or a borg GUI, such as Vorta
  2. Setup an ssh key to connect to the remote host with ssh_keygen
  3. Specify which key borg is going to use to remote server, for instance by adding a host configuration to .ssh/config

    $ cat ~/.ssh/config
    Host borg
      HostName borg.backup.server
      User username
      IdentityFile /User/username/.ssh/id_rsa
      IdentitiesOnly yes
    

    or, alternatively, by setting BORG_RSH to ssh -i /User/username/.ssh/id_rsa, if you use the command line version.

  4. Configure Vorta, by setting:
    • remote repo
    • directories to backup and to exclude
    • pruning strategy
    • backup frequency
  5. If Vorta complains about borg not being installed on the server (while it actually is1), add the following to the authorized_keys on the ssh server:

    $ cat ~/.ssh/authorized_keys
    command="/usr/local/bin/borg serve --restrict-to-path /path/to/repo",restrict ssh-rsa AAAAB3[...]
    

Useful links

Footnotes:

1

Notice that borg does not need to be installed on the server for Borg to work, but it works better if you do.