Software Update: Looking for a Script to Control

The Mac OS X Software Update does not allow for control beyond Weekly/Daily/Monthly setting.

Is there a way I can set it to run at a specific hour via a script?

Hi,

install a launchd agent, which runs /usr/sbin/softwareupdate at a specific time
You can install the updates automatically, or if you want to see the GUI window before installing, list the updates.
If the list is not empty, launch the Software Update PrefPane with GUI scripting.

PS: Personally I don’t understand, why the daily option isn’t sufficient

Thanks for the info!

So, here’s the deal. A buddy of mine uses a limited bandwith/download system via satellite. But he gets unlimited bandwidth from 2 to 5 am. So, he’s trying to find a way to set Apple’s ‘Software Update’ to 2 am.

Thanks again!

As well, might you point me in a direction where I could get a tutorial as to how to write the Launchd agent? I’m a noob.

As Software Update must be run as root, the launchd agent must be placed in the main library.
The agent opens the application Software Update directly, the appearance is the same as calling it from the PrefPane

  1. Create a plain text file, with the contents below, and save it on your desktop as software.update.plist with UTF-8 text encoding.
    The time is set to 16:00 (4 pm), change the numbers of the Hour / Minute keys to the value you want (24 hr mode!)

[code]<?xml version="1.0" encoding="UTF-8"?>

Label software.update LowPriorityIO Program /System/Library/CoreServices/Software Update.app/Contents/MacOS/Software Update StartCalendarInterval Hour 16 Minute 0 [/code] 2) Check if the folder [b]/Library/LaunchAgents[/b] exists (important: the library on the root level of the startup volume) [u]If the folder exists,[/u] drag the file software.update.plist into /Library/LaunchAgents. You will be prompted to authenticate. Copy the following line in a terminal window, press return and type in your admin password (there is no echo!) [code]sudo chown root:wheel /Library/LaunchAgents/software.update.plist[/code] [u]if the folder doesn't exist,[/u] create a folder LaunchAgents on your desktop, put the file into it and drag the folder into /Library. You will be prompted to authenticate. Copy the following line in a terminal window, press return and type in your admin password (there is no echo!) [code]sudo chown -R root:wheel /Library/LaunchAgents[/code] 3) Activate the agent with [code]sudo launchctl load -w /Library/LaunchAgents/software.update.plist[/code]