systemd service used for scheduling does not work #329
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#329
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?
What I'm trying to do and why
I followed the guide to install systemd borgmatic.service and borgmatic.timer by installing the following service unit:
If I run the command
sudo /usr/bin/systemd-inhibit --who="borgmatic" --why="Prevent interrupting scheduled backup" /root/.local/bin/borgmatic -v 2 --log-file /tmp/borgmatic.log --log-file-verbosity 2
on command line, everythin works fine.If I run
sudo systemctl start borgmatic
it fails. The journal shows these messages:This error appears:
Environment
borgmatic version: 1.5.6
borgmatic installation method:
sudo pip3 install --user
Borg version: [version here]
Use
sudo borg --version
Python version:
operating system and version: oracle-linux 7.8
Thanks for reporting this. I'm really not sure what's going on here though. It appears that systemd is parsing the
systemd-inhibit
line incorrectly and treating part of thePrevent interrupting ...
string as the command to run! Really odd. For what it's worth, this does not reproduce on my machine (Manjaro Linux).I checked the list of systemd compatibility limitations for Oracle 7, but I don't see anything obvious there that might cause this. One thing you could try is removing the whole
--why="..."
flag, in case that's tripping it up. Then if that's still not working, you can remove the wholesystemd-inhibit
and arguments, so the line reads more like:That would lose the systemd lock that prevents sleep/shutdown/etc. during a backup, but that may not even be a feature you need.
You're right, after removing the --why="WORD1 WORD2" argument, now the service can be run via systemctl.
Thank you
Awesome, glad to hear it! Let me know if you run into any other problems.