Borgbackup using Synology targets

  • Hi, I think I've almost figured this one out (I'm an OMV newb and I can hold my own in Linux basics if I spend enough time with a search engine 8o) I'm testing out OMV 5 as a potential replacement for my Synology NAS, and currently I back up my main Synology to another remote Synology unit using the Synology DSM backup utility, Hyper Backup. If OMV becomes my main NAS, I'm quite impressed by what I've seen and heard regarding BorgBackup and would like to try and use that for my backup solution. There is a hangup though. My backup target Synology is an ARM-based unit and so while there is a community plugin for BorgBackup to act as a server, apparently when a client (such as OMV) connects, the binary for BorgBackup is not in the default remote path, so the Borg client on OMV cannot either create a new repo or import an existing repo, and throws an error. If I SSH into my OMV server as root and attempt to create the remote repo that way (I've already set up key auth) it works to create the remote repo, but only if I use the --remote-path parameter. However, I cannot import that newly created repo using the OMV GUI. Is it possible to modify the existing OMV BorgBackup plugin to include the ability to use additional command line arguments for repo initialization or import? I think this may currently be the only thing getting in the way of making this work for me, and I'd like to avoid having to mess with the Synology filesystem in the interest of stability and resilience through firmware upgrades.

    It seems to me this would also be a problem for future BorgBackup activity through the GUI even if I managed to create or import an existing repo, since every time the OMV Borg client connected to the remote server, it would need to know the location of the Borg binary.

    If it's as simple as setting an environment variable, that would be awesome, but I haven't had any success with that thus far.

    Here is my full (working) command for reference:

    borg init --encryption=repokey-blake2 borgbackupuser@ --remote-path /usr/local/bin/borg

    Thanks in advance!

  • Of course, since I just got around to posting about it, I think I figured it out 🤦‍♂️. I dislike when people figure out their own problems and never post the answer, so here goes!

    Process is as follows:

    • on the destination Synology, sign in to SSH as the backup user account, and modify the SSH authorized_keys file:
      • borgbackupuser@DS218j:/volume1/borgbackup$ vim ~/.ssh/authorized_keys
    • before each SSH key in the keyfile, prepend with this string (modified to whatever your repo path will be, and borg binary location):
      • command="/usr/local/bin/borg serve --restrict-to-path /volume1/borgbackup/"
      • example:
        • command="/usr/local/bin/borg serve --restrict-to-path /volume1/borgbackup/" ssh-rsa AAAAB3NzaC1y... (continues with full key)

    This allowed me to create the Borg repo on the destination Synology unit using the OMV GUI.

  • chente

    Added the Label resolved

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!