3

Trying to use borg to backup Machine 1 to a remote Machine 2(which is synology), gives the error

Remote: sh: borg: command not found
Connection closed by remote host. Is borg working on the server?

All permissions and firewall have been tested. Machine1 can ssh to Machine2 but when trying to do borg init --encryption=repokey borgdemo@Machine2:./demo from Machine1, it is giving the above error. Trying to use borg on Machine2 works fine. Any ideas?

Vasiliki
  • 143
  • 1
  • 8

2 Answers2

6

Sometimes, you cannot create such a symlink on the remote server (not enough rights on machine 2)

so, the quickest way to deal with different paths is to use the --remote-path argument on the client side:

/usr/bin/borg init --remote-path /usr/local/bin/borg borgdemo@Machine2:./demo

...but the best solution is to force an absolute path on the server side on the ssh config

$ cat .ssh/authorized_keys
command="/usr/local/bin/borg serve" ssh-ed25519 AAAAC...xyz

with this setting, every borg connection from the client through the ssh tunnel will be handled on the server side calling the right binary

0

Oh, I found the answer here. https://pod.disroot.org/posts/e18176ef-415c-e091-c340-9b5239891533

So, doing which borg on Machine1 was giving me /usr/bin/borg and on Machine2 the output was /usr/local/bin/borg. All it takes is to create a symlink on Machine2 so it will look like this

borg -> /usr/local/bin/borg
Vasiliki
  • 143
  • 1
  • 8