2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-23 03:18:55 +00:00

rebuild-index: report added/removed/reindexed files

This should help with investigating missing pack files.
This commit is contained in:
Michael Eischer 2021-01-28 21:27:41 +01:00
parent b71c52797a
commit ff95999246

View File

@ -88,6 +88,11 @@ func rebuildIndex(opts RebuildIndexOptions, gopts GlobalOptions, repo *repositor
packSizeFromList[id] = packSize packSizeFromList[id] = packSize
removePacks.Insert(id) 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) delete(packSizeFromIndex, id)
return nil 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 // forget pack files that are referenced in the index but do not exist
// when rebuilding the index // when rebuilding the index
removePacks.Insert(id) removePacks.Insert(id)
Warnf("removing not found pack file %v\n", id)
} }
if len(packSizeFromList) > 0 { if len(packSizeFromList) > 0 {