Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion check_time_machine_currency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ isMavericks=`echo $osVersion '< 10.9' | bc -l`
if [ $isMavericks -eq 0 ]
then
# 10.9+ Check
tmIsRunning=`tmutil status | grep Running | awk '{print $3}' | awk -F';' '{print $1}'`
if [ "$tmIsRunning" == "1" ]
then
printf "OK - Time Machine is backing up on this Mac!\n"
exit 0
fi
lastBackupDateString=`tmutil latestbackup | grep -E -o "[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}"`

if [ "$lastBackupDateString" == "" ]
Expand Down Expand Up @@ -105,4 +111,4 @@ then
else
printf "CRITICAL - Could not determine the last backup date for this Mac.\n"
exit 2
fi
fi