mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-23 14:41:43 +00:00
only print stats if not Ctrl-C'ed
if the user interrupts by ctrl-c, we do not save the archive, thus we can not show stats because archive.id will not be in the chunks index.
This commit is contained in:
parent
6844d33e7f
commit
649603f247
1 changed files with 14 additions and 14 deletions
|
@ -617,20 +617,20 @@ def create_inner(archive, cache, fso):
|
|||
self.print_error("Got Ctrl-C / SIGINT.")
|
||||
else:
|
||||
archive.save(comment=args.comment, timestamp=args.timestamp, stats=archive.stats)
|
||||
args.stats |= args.json
|
||||
if args.stats:
|
||||
if args.json:
|
||||
json_print(basic_json_data(manifest, cache=cache, extra={
|
||||
'archive': archive,
|
||||
}))
|
||||
else:
|
||||
log_multi(DASHES,
|
||||
str(archive),
|
||||
DASHES,
|
||||
STATS_HEADER,
|
||||
str(archive.stats),
|
||||
str(cache),
|
||||
DASHES, logger=logging.getLogger('borg.output.stats'))
|
||||
args.stats |= args.json
|
||||
if args.stats:
|
||||
if args.json:
|
||||
json_print(basic_json_data(manifest, cache=cache, extra={
|
||||
'archive': archive,
|
||||
}))
|
||||
else:
|
||||
log_multi(DASHES,
|
||||
str(archive),
|
||||
DASHES,
|
||||
STATS_HEADER,
|
||||
str(archive.stats),
|
||||
str(cache),
|
||||
DASHES, logger=logging.getLogger('borg.output.stats'))
|
||||
|
||||
self.output_filter = args.output_filter
|
||||
self.output_list = args.output_list
|
||||
|
|
Loading…
Reference in a new issue