Backup Yunohost with Borg to Synology

My YunoHost server

Hardware: Raspberry Pi at home
YunoHost version: current
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

Hi,

I want to backup my Yunohost(YH) instance on my Synology Diskstation (DS).
I created a user (borg-backup) on the DS and added the public key and also installed borg from the community repository. I can access DS with SSH from YH without password.

Repository: ssh://borg-backup@192.168.xxx.xxx:22/volume1/homes/borg-backup

But I alway get this error:

- Logs begin at Tue 2022-02-15 16:12:38 GMT, end at Tue 2022-02-15 17:16:35 GMT. --
Feb 15 16:18:55 systemd[1]: Starting Run backup borg...
Feb 15 16:18:55 sudo[9806]:     borg : /etc/sudoers.d/borg is owned by uid 991, should be 0 ; TTY=unknown ; PWD=/ ; USER=root ;
Feb 15 16:18:55 sudo[9806]: sudo: /etc/sudoers.d/borg is owned by uid 991, should be 0
Feb 15 16:18:55 sudo[9806]: We trust you have received the usual lecture from the local System
Feb 15 16:18:55 sudo[9806]: Administrator. It usually boils down to these three things:
Feb 15 16:18:55 sudo[9806]:     #1) Respect the privacy of others.
Feb 15 16:18:55 sudo[9806]:     #2) Think before you type.
Feb 15 16:18:55 sudo[9806]:     #3) With great power comes great responsibility.
Feb 15 16:18:55 sudo[9806]: sudo: no tty present and no askpass program specified
Feb 15 16:18:55 sudo[9806]: pam_unix(sudo:auth): conversation failed
Feb 15 16:18:55 sudo[9806]: pam_unix(sudo:auth): auth could not identify password for [borg]
Feb 15 16:18:55 sudo[9806]:     borg : user NOT authorized on host ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/local/bin/backup-with-borg borg
Feb 15 16:18:55 systemd[1]: borg.service: Main process exited, code=exited, status=1/FAILURE
Feb 15 16:18:55 systemd[1]: borg.service: Failed with result 'exit-code'.
Feb 15 16:18:55 systemd[1]: Failed to start Run backup borg.

Would be someone so kind and point me in the right direction what I do wrong?
Thanks :slight_smile:

In SSH, try sudo chown root:root /etc/sudoers.d/borg :crossed_fingers:

1 Like

Sorry to ask a bit dumb, on which machine? :slight_smile:

On the one running the backup, I suppose.

Response:

sudo: /etc/sudoers.d/borg is owned by uid 991, should be 0

Zblerg, then let’s try to run su, which will ask for the root password (should be equal to the regular admin password), that will allow to become root

Then chown root:root /etc/sudoers.d/borg

2 Likes

Thanks, that helped! no more error in services.

Just one more question… I found out, that I have to include the option

--remote-path=/usr/local/bin/borg

to the borg command, but how can I do this in Yunohost?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.