From ff95999246c39a73f0af23fff706628f0fbd5d33 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Thu, 28 Jan 2021 21:27:41 +0100 Subject: [PATCH] rebuild-index: report added/removed/reindexed files This should help with investigating missing pack files. --- cmd/restic/cmd_rebuild_index.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/restic/cmd_rebuild_index.go b/cmd/restic/cmd_rebuild_index.go index 3af5af29e..2ac7b2613 100644 --- a/cmd/restic/cmd_rebuild_index.go +++ b/cmd/restic/cmd_rebuild_index.go @@ -88,6 +88,11 @@ func rebuildIndex(opts RebuildIndexOptions, gopts GlobalOptions, repo *repositor packSizeFromList[id] = packSize removePacks.Insert(id) } + if !ok { + Warnf("adding pack file to index %v\n", id) + } else if size != packSize { + Warnf("reindexing pack file %v with unexpected size %v instead of %v\n", id, packSize, size) + } delete(packSizeFromIndex, id) return nil }) @@ -98,6 +103,7 @@ func rebuildIndex(opts RebuildIndexOptions, gopts GlobalOptions, repo *repositor // forget pack files that are referenced in the index but do not exist // when rebuilding the index removePacks.Insert(id) + Warnf("removing not found pack file %v\n", id) } if len(packSizeFromList) > 0 {