Skip to content

Commit

Permalink
Corrected the sizes of today's backups
Browse files Browse the repository at this point in the history
  • Loading branch information
matteocorti committed Jul 21, 2023
1 parent 792a9ce commit b2f8f9d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2023-07-21 Matteo Corti <[email protected]>

* tmstatus.sh: Corrected the size of the last backups (same values as Backup Loupe)

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

* tmstatus.sh: show the size of todays backups
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* 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
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Show the size of todays backups
Corrected the sizes of today's backups
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.16.0
1.17.0
7 changes: 5 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.16.0
VERSION=1.17.0

export LC_ALL=C

Expand Down Expand Up @@ -453,6 +453,9 @@ if echo "${status}" | grep -q 'BackupPhase'; then
percent='100%'
elif echo "${percent}" | grep -q 'FractionDone = 0'; then
percent='0%'
elif echo "${percent}" | grep -q '^0'; then
# remove the leading 0
percent=$( echo "${percent}" | sed 's/^0//' )
fi
printf 'Percent:\t%s\n' "${percent}"

Expand Down Expand Up @@ -553,7 +556,7 @@ if [ -n "${TODAY}" ]; then
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 'Files Copied' | 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' | sed -e 's/.*p: //' -e 's/).*//')
TODAYS_BACKUPS=$(echo "${TODAYS_BACKUPS}" | sed "s/${b}/${b} (${b_size})/")
done

Expand Down

0 comments on commit b2f8f9d

Please sign in to comment.