Prune "suspicious state" detection

Rather than pollute `restic prune` wipes repo if snapshot listing fails · Issue #4612 · restic/restic · GitHub , I was wondering if it might be worthwhile adding in a little paranoia to the prune logic. If a scan detects that zero snapshots are still in use, or if the prune size is equal to the total repository size, then it may be worth considering this to be an erroneous state. Perhaps a --force flag might then be available for cases where the user wishes to prune the entire repository.

2 Likes

Giving this solution a +1 this class of bug is pretty scary.

I think philosophically this feels like what I’d expect in line with restic’s other defaults e.g. in the forget docs restic refuses the operation if it recognizes that all snapshots will be removed. Seems like a good idea for prune to have the same defenses.

I’ve opened restic prune should refuse to work on repositories without snapshots · Issue #4619 · restic/restic · GitHub .

1 Like