Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Updated with support for OS X Yosemite (10.10) #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
9 changes: 5 additions & 4 deletions check_time_machine_currency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ then
exit 3
fi

# Check to see if we're running Mavericks as Time Machine runs a little differently
osVersion=`sw_vers -productVersion | grep -E -o "[0-9]+\.[0-9]"`
# Check to see if we're running Mavericks or Yosemite as Time Machine runs a little differently
osVersion=`sw_vers -productVersion | grep -E -o "[0-9]+\.[0-9]?[0-9]"`
isMavericks=`echo $osVersion '< 10.9' | bc -l`
isYosemite=`echo $osVersion '< 10.10' | bc -l`

if [ $isMavericks -eq 0 ]
if [ $isMavericks -eq 0 ] || [ $isYosemite -eq 0 ]
then
# 10.9+ Check
lastBackupDateString=`tmutil latestbackup | grep -E -o "[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{6}"`
Expand Down Expand Up @@ -105,4 +106,4 @@ then
else
printf "CRITICAL - Could not determine the last backup date for this Mac.\n"
exit 2
fi
fi