mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-25 01:06:50 +00:00
Let prune --list display archives deleted per total archives
This commit is contained in:
parent
029469d544
commit
0994a0a681
1 changed files with 7 additions and 1 deletions
|
@ -1016,6 +1016,10 @@ def do_prune(self, args, repository, manifest, key):
|
|||
stats = Statistics()
|
||||
with Cache(repository, key, manifest, do_files=args.cache_files, lock_wait=self.lock_wait) as cache:
|
||||
list_logger = logging.getLogger('borg.output.list')
|
||||
if args.output_list:
|
||||
# set up counters for the progress display
|
||||
to_delete_len = len(to_delete)
|
||||
archives_deleted = 0
|
||||
for archive in archives_checkpoints:
|
||||
if archive in to_delete:
|
||||
if args.dry_run:
|
||||
|
@ -1023,7 +1027,9 @@ def do_prune(self, args, repository, manifest, key):
|
|||
list_logger.info('Would prune: %s' % format_archive(archive))
|
||||
else:
|
||||
if args.output_list:
|
||||
list_logger.info('Pruning archive: %s' % format_archive(archive))
|
||||
archives_deleted += 1
|
||||
list_logger.info('Pruning archive: %s (%d/%d)' % (format_archive(archive),
|
||||
archives_deleted, to_delete_len))
|
||||
Archive(repository, key, manifest, archive.name, cache,
|
||||
progress=args.progress).delete(stats, forced=args.forced)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue