• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Switching Time Machine on and off
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Switching Time Machine on and off


  • Subject: Switching Time Machine on and off
  • From: Ronald Hofmann <email@hidden>
  • Date: Sun, 02 Sep 2012 09:09:25 +0200

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



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Switching Time Machine on and off
      • From: Alex Zavatone <email@hidden>
    • Re: Switching Time Machine on and off
      • From: Ron Hunsinger <email@hidden>
  • Prev by Date: Re: scripting Apple Disk Utility
  • Next by Date: Re: Switching Time Machine on and off
  • Previous by thread: Re: scripting Apple Disk Utility
  • Next by thread: Re: Switching Time Machine on and off
  • Index(es):
    • Date
    • Thread