systemd timer doesn't work, followed instructions exactly as posted #428
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#428
Loading…
Reference in New Issue
Block a user
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
Run borgmatic automatically every day
Steps to reproduce (if a bug)
Follow instructions exactly as posted: https://torsion.org/borgmatic/docs/how-to/set-up-backups/
Actual behavior (if a bug)
Running
sudo borgmatic
in terminal works as expected.borgmatic.timer is set in systemctl correctly and listed under
systemctl list-timers
.systemctl status borgmatic.service
shows that it's triggered by the timer.After the timer is triggered, no new backups are listed under
sudo borgmatic --list
. Checkingsystemctl status borgmatic.service
returns errors:Expected behavior (if a bug)
Backup as normal
Other notes / implementation ideas
Environment
borgmatic version: 1.5.15
borgmatic installation method: sudo pacman -S borgmatic
Borg version: borg 1.1.16
Python version: Python 3.9.5
Database version (if applicable): N/A
operating system and version: Arch Linux (latest release, everything is up to date)
systemd version:
systemd 248 (248.3-2-arch)
+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified
I fixed it. The sample systemd service file (borgmatic.service) is incorrect and causes errors.
Remove/comment out the
ExecStartPre
line, and change the ExecStart line to:/root/.local/bin/borgmatic
doesn't exist, but even changing to the correct/usr/bin/borgmatic
file doesn't fix it. You need to remove the whole systemd-inhibit part also or it won't work.I also noticed that the service doesn't prune after it's done so I guess you'll need to modify the borgmatic.service file further to get that working too. I'll reply to this comment when I get that sorted too.
Based on the log
Failed to execute : No such file or directory
, that leads me to think that there's no borgmatic binary at/root/.local/bin/borgmatic
. If you did install borgmatic viapacman
, then borgmatic will be present at a different location, likely/usr/local/bin
. So you may be able to swap the/root/.local/bin/borgmatic
in the last line of the sample systemd service file for/usr/local/bin
.Please let me know if that works for you!
Ah ok, so it's due to pacman changing the installation directory (and some other issue with systemd-inhibit it seems)?
Perhaps adding a comment to the sample borgmatic.service file about changing the path to /usr/bin/borgmatic if you installed via pacman would be a good addition?
The borgmatic package from Arch you installed with
pacman
actually includes its own systemd service file that refers to/usr/bin/borgmatic
! But what I can do is update the borgmatic docs to mention this. Thanks!