mirror of
https://github.com/borgbackup/borg.git
synced 2024-09-11 12:36:12 +03:00
Add repair count to borg check --repair output
This commit is contained in:
parent
aada9859ff
commit
4060064085
@ -1870,9 +1870,14 @@ def check(
|
||||
match=match, first=first, last=last, sort_by=sort_by, older=older, oldest=oldest, newer=newer, newest=newest
|
||||
)
|
||||
self.orphan_chunks_check()
|
||||
self.repair_count = 0
|
||||
self.orphan_chunks_check()
|
||||
self.finish()
|
||||
if self.error_found:
|
||||
logger.error("Archive consistency check complete, problems found.")
|
||||
if self.repair_count > 0:
|
||||
logger.error(f"Archive consistency check complete, problems found and {self.repair_count} problem(s) repaired.")
|
||||
else:
|
||||
logger.error("Archive consistency check complete, problems found.")
|
||||
else:
|
||||
logger.info("Archive consistency check complete, no problems found.")
|
||||
return self.repair or not self.error_found
|
||||
@ -2338,7 +2343,9 @@ def orphan_chunks_check(self):
|
||||
)
|
||||
for id_ in unused:
|
||||
self.repository.delete(id_)
|
||||
self.repair_count += 1
|
||||
logger.info("Finished deleting orphaned/superseded objects.")
|
||||
|
||||
else:
|
||||
logger.info("Orphaned objects check skipped (needs all archives checked).")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user