Recommended borgmatic.service settings for non-root use? #669
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
borgmatic-collective/borgmatic#669
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What I'm trying to do and why
I've been running borgmatic as a non-root user on several systems, mainly to backup home directories. The borgmatic.service template is written for root.
I had set up a systemd timer for my user to run borgmatic, but I'm quite unsure about all the options in the above service file. Could we have some guidance on how to adopt that file for a user?
Other notes / implementation ideas
I had been using a very minimal service file to run as my user. It works, but am I missing anything important from the provided template? If I understand correctly, the security and capability settings probably aren't needed. However, I don't know if controlling things like CPU niceness or if using systemd-inhibit are things my non-root user can do.
In any case, this is what I am using. Am I missing anything crucial when compared to the template file? Thank you.
borgmatic.service:
Environment
borgmatic version: 1.7.11
borgmatic installation method: Arch community package
Borg version: 1.2.4
Python version: 3.10.10
Database version (if applicable): n/a
operating system and version: 6.2.9-arch1-1
Great question! I'm no systemd expert, but here's my take:
systemd-inhibitjust prevents system sleep/shutdown while borgmatic is running. If you want to use it from a systemd user service, it looks like you can. But it's up to you as to whether you want that functionality.Hope that helps.
Thank you for the reply!
Interesting about the
systemd-inhibitcall. Since borg supports resumed backups, I'll keep it off the laptop at least.Good call on the verbosity flags... I was wondering where my logs were recently!
Sounds good! I'll close this for now, but feel free to post any followups including findings on using borgmatic with a non-root systemd service.
Thank you guys, I have spent days figuring out why I am getting an error using the default root systemd service. In my case, I am running Borgmatic as a non-root user. Although I installed borgmatic as root user, I changed ownership of /etc/borgmatic/config.yaml and other scripts to a local non-root user and changed many things, but at the same time, some paths I have used to backup are owned by the root user; therefore, I had to apply ACL commands to be able to read those paths as a non-root user. Finally, I used the template for a non-root user, and it is now working.
Thanks