Attempt to use volume + copy to sftp fails due to permissions #411
Unanswered
doenietzomoeilijk
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having a go at setting up autorestic, and so far the process is easy enough for files that are just local files, which is great!
I'm now running into a snag with backing up data from a container, though. I have a container that uses two volume mounts. I'd hope the attempt to fix the one-volume-per-location limitation, as mentioned in #342, would find its way into the repo at some point, but until that time, I can make do with two separate locations. This is not the issue.
My backend is sftp (on Hetzner Box). Using the particular combination of volume+sftp isn't possible, and going through the source code makes it clear why that is (for those at home: basically the remote gets bind-mounted into a container, together with the location volume, and then restic gets run in the container; obviously, you can't bind-mount an sftp remote).
So, I think to myself, I'll just add a local backend, backup my volume to that, and use
copyto get it to my sftp remote.This gets half way: the local backend gets used, there's data in there. However, due to how the docker container is used for a volume backend, the data is owned by root, rather than the user which runs autorestic. This causes the copy to fail, obviously, with a somewhat cryptic
exit status 1.Another snoop through the code doesn't give me the idea that I can easily slip a
--user=...into the command line, right? I'd rather not run things as root if I can avoid it...Is there any other way in which I can get this working, or would I need to get my hands dirty and see how rusty (ha) my Golang knowledge is?
Edit: now that I take another look at it, a check similar to this one ("if the current user is not root, add a
--user=argument to the docker commandline") might do the trick?Beta Was this translation helpful? Give feedback.
All reactions