Last active
May 21, 2018 04:02
-
-
Save jfeilbach/53b768169051ab4a3d1bf983af675a91 to your computer and use it in GitHub Desktop.
a watched pot never boils; time machine status and time remaining
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
RUN=$(tmutil status |grep 'Running' | awk '{ print $3 }' | tr -d ";") | |
if [[ "$RUN" = "1" ]] | |
then | |
echo running | |
while true | |
do | |
secs=$(tmutil status | grep 'TimeRemaining' |awk '{ print $3 }' | tr -d ";") | |
STATUS=$(tmutil status | awk '/_raw_Percent/ {print $3}' | grep -o '[0-9].[0-9]\+' | awk '{print $1*100}') | |
REM=$(printf '%dh:%dm:%ds\n' $(($secs/3600)) $(($secs%3600/60)) $(($secs%60))) | |
echo "$STATUS% complete $REM remaining" | |
sleep 60 | |
done | |
else echo not running | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment