mirror of https://github.com/borgbackup/borg.git
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
|
@ -617,20 +617,20 @@ class Archiver:
|
||||||
self.print_error("Got Ctrl-C / SIGINT.")
|
self.print_error("Got Ctrl-C / SIGINT.")
|
||||||
else:
|
else:
|
||||||
archive.save(comment=args.comment, timestamp=args.timestamp, stats=archive.stats)
|
archive.save(comment=args.comment, timestamp=args.timestamp, stats=archive.stats)
|
||||||
args.stats |= args.json
|
args.stats |= args.json
|
||||||
if args.stats:
|
if args.stats:
|
||||||
if args.json:
|
if args.json:
|
||||||
json_print(basic_json_data(manifest, cache=cache, extra={
|
json_print(basic_json_data(manifest, cache=cache, extra={
|
||||||
'archive': archive,
|
'archive': archive,
|
||||||
}))
|
}))
|
||||||
else:
|
else:
|
||||||
log_multi(DASHES,
|
log_multi(DASHES,
|
||||||
str(archive),
|
str(archive),
|
||||||
DASHES,
|
DASHES,
|
||||||
STATS_HEADER,
|
STATS_HEADER,
|
||||||
str(archive.stats),
|
str(archive.stats),
|
||||||
str(cache),
|
str(cache),
|
||||||
DASHES, logger=logging.getLogger('borg.output.stats'))
|
DASHES, logger=logging.getLogger('borg.output.stats'))
|
||||||
|
|
||||||
self.output_filter = args.output_filter
|
self.output_filter = args.output_filter
|
||||||
self.output_list = args.output_list
|
self.output_list = args.output_list
|
||||||
|
|
Loading…
Reference in New Issue