From 938e7f295c65e847dbad4862e5fc02244399e73f Mon Sep 17 00:00:00 2001 From: Elmar Hoffmann Date: Fri, 14 May 2021 18:17:04 +0200 Subject: [PATCH] add progress indicator for archive check Depending on the number of archives in a repository, the archive check part of the check operation can take some time, so it should have a progress indicator as well. --- src/borg/archive.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/borg/archive.py b/src/borg/archive.py index 52cfb26be..50c90721d 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -1877,8 +1877,11 @@ class ArchiveChecker: return num_archives = len(archive_infos) + pi = ProgressIndicatorPercent(total=num_archives, msg='Checking archives %3.1f%%', step=0.1, + msgid='check.rebuild_refcounts') with cache_if_remote(self.repository) as repository: for i, info in enumerate(archive_infos): + pi.show(i) logger.info('Analyzing archive {} ({}/{})'.format(info.name, i + 1, num_archives)) archive_id = info.id if archive_id not in self.chunks: @@ -1908,6 +1911,7 @@ class ArchiveChecker: cdata = self.key.encrypt(data) add_reference(new_archive_id, len(data), len(cdata), cdata) self.manifest.archives[info.name] = (new_archive_id, info.ts) + pi.finish() def orphan_chunks_check(self): if self.check_all: