Setup Borg Backup Server on Rsync.net

Setup Borg Backup Server on Rsync.net

There is a great coupon for borg and attic users. Which reduces the price to $0.03/GB/Month but without the same level of support the give normally.

To run a command on rsync.net we need to use ssh -t as we are not given an interactive session. We can put the commands we want to run at the end of the ssh command.
Run ssh -t borg-server pwd so we can find what full path looks like.
It should look something like /data1/home/1234 remember this.

Next we want a new folder for the borg repo, I’m going to call it borg-repo
ssh -t borg-server "mkdir borg-repo; chmod 700 borg-repo"

The next command creates the repository and should be run on your machine not the server.
borg init -–encryption=repokey borg-server:borg-repo

Now for the optional part:
Create a file temp.authorized_keys on your computer with the contents
We’ll need that path you remembered from above. eg. /data1/home/1234

N.B. borg1 uses the lastest version of borg, just using borg uses a very old version.

Changing ssh-rsa AAAAAAAAYOURKEYAAAAA== [email protected] to your ssh public key.

Add any other keys you want to this file and then transfer using scp temp.authorized_keys borg-repo:.ssh/authorized_keys fix up permissions with ssh -t borg-server "chmod 700 .ssh; chmod 600 ssh/authorized_keys".

Now when you login using the private key it’ll be limited to the directory we just setup.

From the docs:
Due to the cd command we use, the server automatically changes the current working directory. Then client doesn’t need to have knowledge of the absolute or relative remote repository path and can directly access the repositories at <user>@<host>:<repo>.

See https://borgbackup.readthedocs.io/en/stable/usage.html#borg-serve

I couldn’t make total sense what the above me and however I tried this command and it worked fine:
borg init --encryption=repokey borg-server:borg-repo/ to create your new repo.
Do it from your client

You can use commands like borg create to add archives to the repo:
borg create -v --stats -p --compression=none borg-server:borg-repo/::-date +%Y-%m-%d/path/to/directory

4 thoughts on “Setup Borg Backup Server on Rsync.net

  1. also – it appears that you can only setup a repo on the home root; that is, can’t set it up under ‘borg-root’

    tested this on regular account, (pays the full rate not the borg/attic discounted rate)

  2. mistake on the two above posts.
    the remote path should be:
    --remote-path /usr/local/bin/borg1/borg1

    and it can be put into any directory – not just the root of home

    1. @jon , thanks for commenting! You are correct I only learnt about borg1 after I posted.

      My setup is slightly different where I use /usr/local/bin/borg1 servein the authorized_keys file instead.

      Strange, I just checked and /usr/local/bin/borg1 appears to be a directory but using it works. *shurg* I’ll try find out which path is best to use.

      --remote-path is the best way to do it if one is not using authorized_keys file.

Leave a Reply

Your email address will not be published. Required fields are marked *