Last active
October 23, 2022 08:15
-
-
Save Patronics/907a7435d637153b46f656f89fe7c4ee to your computer and use it in GitHub Desktop.
Watch detailed Time Machine progress logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#for watching the logs from an Apple Time Machine backup on MacOS | |
#the log will update with new progress every 5 minutes | |
#or get historical records by specifying a durarion of time to look back | |
RED="$(tput setaf 1)" | |
YELLOW="$(tput setaf 3)" | |
CYAN="$(tput setaf 6)" | |
WHITE="$(tput setaf 7)" | |
if (( $# == 0 )); then | |
log stream --predicate 'subsystem == "com.apple.TimeMachine"' --info | |
elif [[ $1 == *-h* ]]; then | |
echo "usage: ${CYAN}$0 [duration]${WHITE}" | |
echo "duration specifier such as ${CYAN}20m${WHITE} or ${CYAN}4h${WHITE}" | |
echo "or ${CYAN}leave duration blank${WHITE} for live data stream" | |
else | |
#to see the recent historical records, pass a time specifier | |
log show --predicate 'subsystem == "com.apple.TimeMachine"' --info --last $1 | |
# choose argument such as 4h to adjust duration to show here ^ | |
fi | |
#to hide non-progress status messages, adjust the --predicate string to | |
#--predicate '(subsystem == "com.apple.TimeMachine") && (category == "CopyProgress")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: this gist has been moved to a dedicated repository, at https://github.com/Patronics/watchTimeMachineLog