2
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-09-06 17:12:31 +02: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 {