Modifying Software Update

Not applicable

We're looking to modify the frequency of update checking within Software Update. I have an Extension looking for what the user has their computer set to.

We would like to find the plist and modify it so that it checks daily, downloads, and installs the updates on machines.

Has anyone had the ability to do this?

Thanks!

David

5 REPLIES 5

winkelhe
New Contributor

turn off software update and use a policy to trigger it whenever you want with something like softwareupdate -ia

eric winkelhake
mundocom technology
312 220 1669

tlarkin
Honored Contributor

you can use launchd, scheduled tasks, or a Casper policy to do this. Software Update has a command line binary, so a simple run once a day script baked in Casper and set to run once per a day and made available offline would run this every day.

from the man page:

bash-3.2# softwareupdate usage: softwareupdate <mode> [<args> ...]

-l | --listList all appropriate updates -d | --downloadDownload Only -i | --installInstall <label> ...specific updates -a | --allall appropriate updates -r | --recommendedonly recommended updates

Per-user preferences: --ignore <label> ...Ignore specific updates --reset-ignoredClear all ignored updates --schedule (on | off)Set automatic checking

-h | --helpPrint this hel

So a quick and dirty example:

/usr/sbin/softwareupdate -i -a

--------- or ----------

jamf runSoftwareUpdate

Just running those commands in an offline policy and set it for once a day will do so in the background. You can also have it force a reboot, however, be weary that users can stop the reboot and it may cause some unsaved data to be lost in current open applications.

-Tom

Not applicable

I realize now in hindsight that I could user Composer. D'oh!

Has anyone had success with this?

tlarkin
Honored Contributor

I do it via self service policy and it works, but I run internal SUS servers and use Casper to set the SUS to my clients by smart group

RobertHammen
Valued Contributor II

You can set the preferences to whatever you want. I borrowed someone's script (posted here) to turn on updates and automatic download - this modifies the com.apple.SoftwareUpdate.<UUID>.plist file in ~/Library/Preferences/ByHost. This script walks through all of the folders in the /Users directory on a machine, establishing preferences. Of course if you create a new user after running this script, unless you modify the /System/Library/User Template, the new users won't get these preferences.
On Nov 30, 2010, at 12:09 PM, David Marcantonio wrote:

#!/bin/bash

for USER in `ls -1 /Users | sed -e '/Shared/d' -e '/Deleted Users/d' -e '/.localized/d'`

do

# Turn on Software Update, silently

sudo -u $USER softwareupdate --schedule on > /dev/null sudo -u $USER defaults -currentHost write com.apple.SoftwareUpdate AgreedToLicenseAgrement -bool YES sudo -u $USER defaults -currentHost write com.apple.SoftwareUpdate AutomaticDownload -bool YES sudo -u $USER defaults -currentHost write com.apple.SoftwareUpdate LaunchAppInBackground -bool YES

done

BTW "AgreedToLicenseAgrement" is NOT a typo. If you wanted to turn off these options, simply change YES to NO.

Now, changing how often updates are checked modifies the com.apple.scheduler.<UUID>.plist file, also in ~/Library/Preferences/ByHost. You could probably find a way to script that if you wanted to.

You can't force the installation of updates at a specific time - as others have said, create a once-per-day policy that runs "softwareupdate -i -a" or "jamf runSoftwareUpdate".

I don't typically force updates, but, for one of my clients, created a Smart Group of machines that are out of scope (i.e. not 10.6.5), then create a once-daily "nag" script which throws up a message like "Mac OS not up-to-date, please run Software Update" and then opens Software Update in the background ;). But what works in this client may not work in yours; YMMV (your mileage may vary).

--Robert