Allow running borgmatic without root access #50
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#50
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I recently reinstalled my GNU/Linux machine and to my surprise found that simply running
borgmatic
yieldedError: No configuration files found in: /etc/borgmatic/config.yaml /etc/borgmatic.d
. If I usedsudo borgmatic
, it would start a backup. Personally, I only want to backup~/
, and I don't want to invoke root privileges. Is there anyway of doing this? I saw the-c
method, but I'm also interested in using thesystemd.service
file to run backups in the background. I could be just missing somethings obvious. Thanks for your time.As far as I know, running borgmatic as non-root should totally be possible. Your instinct is correct that you'd need to select a non-root configuration file with
-c
.I haven't used
systemd.service
myself, but if it's possible to set that up as a non-root user to run scheduled jobs, then that should work for your needs. I know for instance that crond is configurable as a non-root user.Let me know if this all works for you or if you run into any roadblocks.
Okay, I'll do some more testing later today. Question: is running
borgmatic
supposed to be from an unprivileged user (ie nosudo borgmatic
)?Yes, as far as I know, it should be able to run as a non-root user as long as that user has permissions to do everything it needs to do (read config files, write to the selected Borg repository, etc).
I'll close this in favor of #51, but if you encounter any other issues while running as non-root, please let me know.
Thanks for the input. The issue stemmed from running
sudo generate-borgmatic-config
. It didn't give any account access permission to read the contents of/etc/borgmatic/config.yaml
. After comparing the permissions with other directories in/etc
(like/etc/apt
), I changed the permission to "Access Files" (which is the same as the other directories in the/etc
tree). Now, it runs great.Great, glad to hear it!