--check-unused and exit code / fatal warnings

I’ve just been caught out by a restic check with --check-unused reporting that the repo contains errors when it finds unused blobs. By caught out I mean this hour six of trying to figure out why :-
Edit: Actually, I think over the past six months I’ve had a fair few customer restic’s report bad repos as I was using this flag, so it’s been haunting me for some time!

Should this actually be reported as “fatal” and “contains errors”, and/or return exit code 1? If so, should the docs and the --help switch make the user aware of this?

The best option, IMO, is just not to use --check-unused. It doesn’t really tell you anything about the health of the repository that a regular prune won’t take care of.

1 Like

Indeed, sound advice; I’ve already removed it form my wrapper script but wanted to start a discussion on how it ought to act and documented.

1 Like