Hi,
I was wondering if someone could shed some light ton the issue im having, currently have restic working great. every now and then im getting this issue
Dec 25 2018 22:59:49 -05: backup-script started open repository
Fatal: unable to create lock in backend: repository is already locked exclusively by PID 18598 on artemis by (UID 0, GID 0) lock was created at 2018-12-22 23:12:18 (71h47m30.827726356s ago) storage ID 63a97837
Fatal: unable to create lock in backend: repository is already locked exclusively by PID 18598 on artemis by (UID 0, GID 0) lock was created at 2018-12-22 23:12:18 (71h47m31.348829345s ago) storage ID 63a97837
Fatal: unable to create lock in backend: repository is already locked exclusively by PID 18598 on artemis by (UID 0, GID 0) lock was created at 2018-12-22 23:12:18 (71h47m31.86880871s ago) storage ID 63a97837 using temporary cache in /tmp/restic-check-cache-790221529 create exclusive lock for repository
Fatal: unable to create lock in backend: repository is already locked exclusively by PID 18598 on artemis by (UID 0, GID 0) lock was created at 2018-12-22 23:12:18 (71h47m32.404181536s ago) storage ID 63a97837
Same debug workflow as in your other post: find out what ran at the time the lock was last updated, that’s the operation that failed. Make sure it does not fail again, otherwise it’ll again leave a lock which prevents normal backups.
Besides: the script you’re using ignores errors returned by restic: it should have aborted after the first failure to lock the repo. Maybe use set -e in the script (if it’s sh or bash)?
#!/bin/bash
#This will run Restic backups and remove snapshots according to a policy
export RESTIC_REPOSITORY=/media/backupnas2/backup1
export RESTIC_PASSWORD=mypass
# Run Backups
/usr/local/bin/restic -v backup /media/smb2 | tee -a /media/backup.log
# Remove snapshots according to policy
/usr/local/bin/restic forget --keep-last 10 | tee -a /media/backup.log
# Remove unneeded data from the repository
/usr/local/bin/restic prune | tee -a /media/backup.log
# Check the repository for errors
/usr/local/bin/restic check | tee -a /media/backup.log