From ccc44cd649701a2ba0bd0b89902998b46ef62e62 Mon Sep 17 00:00:00 2001 From: Matteo Corti Date: Tue, 15 Aug 2023 13:38:20 +0200 Subject: [PATCH] Corrected the output of ```--today``` when two backups are too near to each other --- ChangeLog | 4 ++++ NEWS.md | 4 +++- RELEASE_NOTES.md | 2 +- VERSION | 2 +- tmstatus.sh | 6 ++++-- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 003310a..bec0364 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2023-08-15 Matteo Corti + + * tmstatus.sh: Corrected the output of --today when two backups are too near to each other + 2023-08-07 Matteo Corti * tmstatus.sh: Corrected the timestamp of the latest backup with multiple destinations diff --git a/NEWS.md b/NEWS.md index 8493eb9..cf1777c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,12 @@ +* 2023-08-15, Version 1.19.0 + * Corrected the output of ```--today``` when two backups are too near to each other * 2023-08-07, Version 1.18.0 * Corrected the timestamp of the latest backup with multiple destinations * 2023-07-21, Version 1.17.0 * Corrected the sizes of today's backups * 2023-07-17. Version 1.16.0 * Show the size of todays backups -* 2023-07-07, Versiom 1.15.0 +* 2023-07-07, Version 1.15.0 * Show information for all the disks (```--all``` option) * 2023-06-27, Version 1.14.0 * Parsing of destinationinfo with more than one destination diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 41f6d89..e77203b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1 +1 @@ -Corrected the timestamp of the latest backup with multiple destinations +Corrected the output of ```--today``` when two backups are too near to each other diff --git a/VERSION b/VERSION index 84cc529..815d5ca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.0 +1.19.0 diff --git a/tmstatus.sh b/tmstatus.sh index d7edc6a..9c39e4a 100755 --- a/tmstatus.sh +++ b/tmstatus.sh @@ -12,7 +12,7 @@ # # shellcheck disable=SC2034 -VERSION=1.18.0 +VERSION=1.19.0 export LC_ALL=C @@ -554,9 +554,11 @@ if [ -n "${TODAY}" ]; then # Information on backup size: https://eclecticlight.co/2021/04/09/time-machine-to-apfs-how-efficient-are-backups/ for b in ${TODAYS_BACKUPS}; do + # the log entry could also be a minute before. It is not accurate but we remove the last digit (could always be wrong if ending with 0 but better than nothing) b_short=$(echo "${b}" | sed 's/[0-9]$//') - b_size=$(echo "${LOG_ENTRIES}" | grep -A 10 "${TODAYS_DATE} ${b_short}" | grep -A 10 'Finished copying from' | grep 'Total Items Added' | sed -e 's/.*p: //' -e 's/).*//') + b_size=$(echo "${LOG_ENTRIES}" | grep -A 10 "${TODAYS_DATE} ${b_short}" | grep -A 10 'Finished copying from' | grep 'Total Items Added' | tail -n 1 | sed -e 's/.*p: //' -e 's/).*//') + TODAYS_BACKUPS=$(echo "${TODAYS_BACKUPS}" | sed "s/${b}/${b} (${b_size})/") done