From 012cb06fe9a4db14618fbdbbbf1f97d1debe4354 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 14 Sep 2024 19:09:58 +0200 Subject: [PATCH] repair snapshots: remove irregular files --- cmd/restic/cmd_repair_snapshots.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/restic/cmd_repair_snapshots.go b/cmd/restic/cmd_repair_snapshots.go index 46ba52dd4..ba952432a 100644 --- a/cmd/restic/cmd_repair_snapshots.go +++ b/cmd/restic/cmd_repair_snapshots.go @@ -92,6 +92,10 @@ func runRepairSnapshots(ctx context.Context, gopts GlobalOptions, opts RepairOpt // - files whose contents are not fully available (-> file will be modified) rewriter := walker.NewTreeRewriter(walker.RewriteOpts{ RewriteNode: func(node *restic.Node, path string) *restic.Node { + if node.Type == restic.NodeTypeIrregular || node.Type == restic.NodeTypeInvalid { + Verbosef(" file %q: removed node with invalid type %q\n", path, node.Type) + return nil + } if node.Type != restic.NodeTypeFile { return node }