From b3f075caf5516452acc512a43e07203989a6136b Mon Sep 17 00:00:00 2001 From: Matteo Guadrini Date: Thu, 2 Jan 2025 09:55:10 +0100 Subject: [PATCH] fix: change last backup selection into get_last_backup function, refs #7 --- CHANGES.md | 4 ++++ bb.py | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 736855c..46ccc38 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Release notes +## 1.13.0 +Jan 02, 2025 +* Fix return of **get_last_backup** function for incremental and differential backup, refs #7 + ## 1.12.0 May 24, 2024 * Add **--no-color** argument diff --git a/bb.py b/bb.py index 619ffb5..208cf35 100755 --- a/bb.py +++ b/bb.py @@ -64,7 +64,7 @@ import utility # region Global Variables -VERSION = "1.12.0" +VERSION = "1.13.0" # endregion @@ -600,7 +600,7 @@ def get_last_full(catalog): :param catalog: configparser object :return: path (string), os (string) """ - global hostname + global hostname, args config = catalog if config: @@ -627,7 +627,7 @@ def get_last_full(catalog): if last_full: utility.print_verbose( args.verbose, - "Last full is {0}".format(last_full), + "Last full backup is {0}".format(last_full), nocolor=args.color, ) for bid in config.sections(): @@ -648,7 +648,7 @@ def get_last_backup(catalog): :param catalog: configparser object :return: path (string), os (string) """ - global hostname + global hostname, args config = catalog dates = [] @@ -672,6 +672,11 @@ def get_last_backup(catalog): dates.sort() last = utility.time_to_string(dates[-1]) if last: + utility.print_verbose( + args.verbose, + "Last backup is {0}".format(last), + nocolor=args.color, + ) for bid in config.sections(): if ( config.get(bid, "name") == hostname and