mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-28 02:38:43 +00:00
borg check: fixup for "deleting orphaned objs" msgs, fixes #3795
only output msgs if there is actually something to delete. be more precise, show count of orphaned / superseded objects.
This commit is contained in:
parent
9256e5c8b5
commit
d671e9acf2
1 changed files with 4 additions and 3 deletions
|
@ -1585,11 +1585,12 @@ def orphan_chunks_check(self):
|
||||||
if orphaned:
|
if orphaned:
|
||||||
logger.error('{} orphaned objects found!'.format(len(orphaned)))
|
logger.error('{} orphaned objects found!'.format(len(orphaned)))
|
||||||
self.error_found = True
|
self.error_found = True
|
||||||
if self.repair:
|
if self.repair and unused:
|
||||||
logger.info('Deleting orphaned objects...')
|
logger.info('Deleting %d orphaned and %d superseded objects...' % (
|
||||||
|
len(orphaned), len(self.possibly_superseded)))
|
||||||
for id_ in unused:
|
for id_ in unused:
|
||||||
self.repository.delete(id_)
|
self.repository.delete(id_)
|
||||||
logger.info('Finished deleting orphaned objects.')
|
logger.info('Finished deleting orphaned/superseded objects.')
|
||||||
else:
|
else:
|
||||||
logger.info('Orphaned objects check skipped (needs all archives checked).')
|
logger.info('Orphaned objects check skipped (needs all archives checked).')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue