restic-backup-docker
restic-backup-docker copied to clipboard
restic snapshots exit code check
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...
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.
Sounds good. Feel free to provide a PR.
have the error too and all my backups cant start anymore :/