but it does not really answer my question: Might there be errors in the repository which are fixable but become unfixable when running prune or rebuild-index or forget or just about any other command?
check --read-data says the repo has errors if it finds “unused blob …”. This can be fixed by prune. But I really do not want to do any write operation if there is a serious error in the repository unless I am absolutely certain it is safe to do.
So what is the correct thing to do for a weekly automated cronjob for cleaning things up?
- check --read-data | grep -v ‘unused blob’ | grep -v ‘not referenced’ | grep -v any normal output
- if output remains, the repository has errors that need to be fixed
- only if the repository has no errors, run prune
- check --read-data again, it should not find errors anymore
- run forget
- prune again
- check # unless it is absolutely certain that forget and prune cannot introduce errors
If the repo has a real error, what is recommended? For a defect disk with a defect filesystem, I should make a full 1:1 copy of the disk and only try to fix the copy. Is that also true for a restic repository?