mirror of
https://github.com/PurpleComputing/helpful-scripts.git
synced 2026-02-03 05:43:24 +00:00
Create tmbackupdate.sh
This commit is contained in:
9
tmbackupdate.sh
Normal file
9
tmbackupdate.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
rm -f /tmp/TMBACKUPDATE.check
|
||||
enabled=`/usr/bin/defaults read /Library/Preferences/com.apple.TimeMachine AutoBackup`
|
||||
if [ "$enabled" == "1" ];then
|
||||
lastBackupTimestamp=`date -j -f "%a %b %d %T %Z %Y" "$(/usr/libexec/PlistBuddy -c "Print Destinations:0:SnapshotDates" /Library/Preferences/com.apple.TimeMachine.plist | tail -n 2 | head -n 1 | awk '{$1=$1};1')" "+%Y-%m-%d %H:%M:%S"`
|
||||
echo Last Backup": $lastBackupTimestamp" >> /tmp/TMBACKUPDATE.check
|
||||
else
|
||||
echo "Time Machine is Disabled" >> /tmp/TMBACKUPDATE.check
|
||||
fi
|
||||
Reference in New Issue
Block a user