You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often get this issue that the repository is locked, and the forget cmd fails:
backup-all.sh[577930]: + [[ 0 -eq 0 ]]
backup-all.sh[578466]: + systemd-cat -t all
backup-all.sh[578467]: ++ date -u '+%Y-%m-%d %H:%M:%S'
backup-all.sh[578465]: + echo '2022-10-19 08:19:03 OK'
all[578466]: 2022-10-19 08:19:03 OK
backup-all.sh[578468]: + /usr/local/bin/restic forget --path / --keep-last 10 --prune
backup-all.sh[578469]: + systemd-cat -t all
all[578469]: unable to create lock in backend: repository is already locked by PID 294851 on sancho.varac.net by root (UID 0, GID 0)
all[578469]: lock was created at 2022-10-18 00:00:05 (34h19m6.088127533s ago)
all[578469]: storage ID 361f61fc
all[578469]: the `unlock` command can be used to remove stale locks
backup-all.sh[577930]: + [[ 1 -eq 0 ]]
backup-all.sh[578486]: + systemd-cat -t all
backup-all.sh[578487]: ++ date -u '+%Y-%m-%d %H:%M:%S'
backup-all.sh[578485]: + echo '2022-10-19 08:19:11 ERROR'
all[578486]: 2022-10-19 08:19:11 ERROR
backup-all.sh[577930]: + rm -f /var/run/restic_backup_all.pid
backup-all.sh[577930]: + exit
systemd[1]: restic-all.service: Deactivated successfully.
systemd[1]: Finished Backup all using restic.
However, in this case the script ends with an exit code of 0 and therefore the systemd service is marked as successful, which makes it very hard to notice when the forget fails:
❯ systemctl status restic-all
○ restic-all.service - Backup all using restic
Loaded: loaded (/lib/systemd/system/restic-all.service; static)
Drop-In: /etc/systemd/system/restic-all.service.d
└─env.conf, untethered.conf
Active: inactive (dead) since Wed 2022-10-19 10:19:11 CEST; 36min ago
TriggeredBy: ● restic-all.timer
Main PID: 577930 (code=exited, status=0/SUCCESS)
CPU: 14min 4.131s
Yes, I am currently not entirely happy with the behaviour of the script and have been planning to revise it for some time. Unfortunately, I haven't got around to it yet.
If you feel like taking a closer look, I would of course appreciate it.
I often get this issue that the repository is locked, and the forget cmd fails:
However, in this case the script ends with an exit code of 0 and therefore the systemd service is marked as successful, which makes it very hard to notice when the forget fails:
It can be reproduced manually as well:
The text was updated successfully, but these errors were encountered: