mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 02:48:55 +00:00
repair snapshots: cleanup warnings
This commit is contained in:
parent
f6cc10578d
commit
7c8dd61e8c
@ -130,11 +130,12 @@ func runRepairSnapshots(ctx context.Context, gopts GlobalOptions, opts RepairOpt
|
||||
},
|
||||
RewriteFailedTree: func(nodeID restic.ID, path string, _ error) (restic.ID, error) {
|
||||
if path == "/" {
|
||||
Verbosef(" dir %q: not readable\n", path)
|
||||
// remove snapshots with invalid root node
|
||||
return restic.ID{}, nil
|
||||
}
|
||||
// If a subtree fails to load, remove it
|
||||
Printf("removed defective dir '%v'", path)
|
||||
Verbosef(" dir %q: replaced with empty directory\n", path)
|
||||
emptyID, err := restic.SaveTree(ctx, repo, &restic.Tree{})
|
||||
if err != nil {
|
||||
return restic.ID{}, err
|
||||
|
Loading…
Reference in New Issue
Block a user