restic-backup-docker icon indicating copy to clipboard operation
restic-backup-docker copied to clipboard

restic snapshots exit code check

Open avgeeklucky opened this issue 3 years ago • 3 comments

This has caused me problems:

https://github.com/lobaro/restic-backup-docker/blob/a07b831d783ce3d96d76201e9f98e849178f9748/entry.sh#L16-L31

Specifically, I've had backups be interrupted mid process (post backup cleanup or the backup it self, not sure) and they have locked the repository, causing restic snapshots to return a non 0 exit code, next the entry script tries to init a new repository which fails because it's already there. Because I've got restart=always, the container ends up in a restart loop.

I'm not sure how to fix this since restic does not provide meaningful exit codes (restic/restic#956). String parsing is not a great idea either...

avgeeklucky avatar Jul 23 '20 17:07 avgeeklucky

I detected the same problem here. Perhaps it would be nice to use the following command

restic --no-lock list locks

This way it is possible to detect logs and provide a meaningful message to warn the user about the problem.

bruno-lopes avatar Dec 28 '20 19:12 bruno-lopes

Sounds good. Feel free to provide a PR.

niondir avatar Dec 28 '20 22:12 niondir

have the error too and all my backups cant start anymore :/

wuast94 avatar Jan 16 '21 15:01 wuast94