Issues with Time machine script.

Eyoung
Contributor

First off, hello all. Casper n00b here.

I have a script that is supposed to set a defaults write for that annoying time machine message whenever you plug in a drive. it does not seem to be working for me when it is deployed with an image. does it have to go as a separate login/logout policy instead? Find the text of the script below.

#!/bin/sh

/usr/bin/defaults write /Network/Servers/student.thayer.org/Volumes/ STUHOMEDIR/STUDENTHOME/$3/Library/Preferences/com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool yes

/usr/bin/defaults write /Network/Servers/faculty.thayer.org/Volumes/ FACHOMEDIR/FACULTYHOME/$3/Library/Preferences/com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool yes

/usr/bin/defaults write /Users/$3/Library/Preferences/ com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool yes

7 REPLIES 7

milesleacy
Valued Contributor

Two tips:

  1. Make sure that in your configuration, this script is set to run 'At reboot' rather than 'before' or 'after'. If you run the script 'after', you're running it on the utility drive you're booted to during the imaging process. 'At reboot' will add your script to the Casper first run script which will be executed the first time you boot the newly imaged system.
  2. You can simplify your script to: defaults write /Library/Preferences/com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool YES

This will put the setting in the /Library folder, which is applied to all
users.

Hope this helps.

Eyoung
Contributor

It is not. it is currently setup to run after a machine is imaged. Now that I write this out that logic seems rather flawed....

seems at login and once per user would be the right way to set that up.

ernstcs
Contributor III

I have this setting as part of a package that has all the user settings we change that is deployed at imaging time with Fill User Templates. Running it at logon should be another way to tackle this as Criss suggests.

Craig

Eyoung
Contributor

Casper is set to run login hooks...or seems to be as some of my login scripts are working (bind OD, etc...)

it is at least good to get confirmation the script itself is valid.. I will break it off and see if I can get it to run as a login more reliably

Eric Young
eyoung at thayer.org
781-664-2286

Eyoung
Contributor

oh excellent. It is currently set per user... and as after. I will adjust this.

John_Wetter
Release Candidate Programs Tester

I don't think it matters in this case, but you can shorten the script up even more to:
defaults write com.apple.timemachine DoNotOfferNewDisksForBackup -bool YES

ernstcs
Contributor III

That's what I've used.

Craig