Skip to content

Commit

Permalink
Corrected the output of --today when two backups are too near t…
Browse files Browse the repository at this point in the history
…o each other
  • Loading branch information
matteocorti committed Aug 15, 2023
1 parent 69195bc commit ccc44cd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-08-15 Matteo Corti <[email protected]>

* tmstatus.sh: Corrected the output of --today when two backups are too near to each other

2023-08-07 Matteo Corti <[email protected]>

* tmstatus.sh: Corrected the timestamp of the latest backup with multiple destinations
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.18.0
1.19.0
6 changes: 4 additions & 2 deletions tmstatus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#

# shellcheck disable=SC2034
VERSION=1.18.0
VERSION=1.19.0

export LC_ALL=C

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit ccc44cd

Please sign in to comment.