I want to backup some files that can only be read as root to a remote repository that only my user has access to. If I run
borg as myself using
/etc as my source I'll get
permission-denied errors when trying to read some files like
/etc/crypttab. If I run
borg as root with
sudo, the files can be read but I can't write to the repository because my local
root user doesn't have ssh access to the remote repository and it doesn't have the repo key for that repository (ie
/root/.borg/ doesn't exist).
$ borg create ssh://me@remote:/backup/my_repo.borg::demo /etc
will error because I can't read some files in
/etc, which I do want backed up. And
$ sudo borg create ssh://me@remote:/backup/my_repo.borg::demo /etc
will fail because root doesn't have neither access to
ssh://me@remote nor the repokey.
Now an obvious work around would be give root ssh access and the repo key but I'm wondering if there is a better solution.