Hi all, for test reasons I sometimes set my macs date back to Jan 1. 2012 and turn it back to today after a couple of minutes. During this period of time I don´t want Time Machine to execute.
Afterwards, when I turn back to today I want Time Machine to run. Unfortunately it doesn´t work as I expected. But what am I doing wrong? Sometimes it looks like it is working.
I realized, when using defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool false in the terminal it´s working fine
but when using defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool false in the terminal I get this: Could not write domain /Library/Preferences/com.apple.TimeMachine; exiting
Any clues?
Ronald ---
------------------------------------------------------------------------------ This is what I have right now to GoBackInTime.scpt: ------------------------------------------------------------------------------ set theDate to uxExecute("date +%m/%d/%Y") try uxExecute("defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool false") uxExecute("System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper -false")
uxExecute("echo " & theDate & " > '/Users/ronny/Library/Application Support/prolog/setusingnetworktime.txt'") #writes theDate to file uxExecute("/usr/sbin/systemsetup -setusingnetworktime Off -setdate '" & "01/31/2012" & "'") end try
on uxExecute(cmd) try do shell script cmd user name "ronny" password "MyPassword" with administrator privileges on error vErrVar vErrVar end try end uxExecute
------------------------------------------------------------------------------ This is what I have right now to ReturnToToday.scpt: ------------------------------------------------------------------------------ tell application "Finder" set fileExistFlag to (exists theHFSPath) end tell
try if fileExistFlag then set theDiskName to "Backup1" set theDate to uxExecute("cat '/Users/ronny/Library/Application Support/prolog/setusingnetworktime.txt'") #reads theDate from file
uxExecute("/usr/sbin/systemsetup -setusingnetworktime On -setdate '" & theDate & "'") uxExecute("rm -rf '/Users/ronny/Library/Application Support/prolog/setusingnetworktime.txt'")
if (list disks) does not contain theDiskName then #turn it off uxExecute("defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool false") uxExecute("System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper -false") else #turn it on uxExecute("defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup -bool true") uxExecute("System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper -true") end if
else
uxExecute("/usr/sbin/systemsetup -setusingnetworktime On")
end if
on error vtErr uxExecute("/usr/sbin/systemsetup -setusingnetworktime On") end try
on uxExecute(cmd) do shell script cmd user name "ronny" password "MyPassword" with administrator privileges end uxExecute |