I am in charge of about 40 Mac OS X computers on a predominantly PC network. The systems are running about an equal mix of Mac OS X 10.5 and 10.6.
We are instituting a new policy of forcing OS and software patches on all machines on a weekly schedule. We have some system management software in place that makes this pretty easy for the PCs, but I'm a little at a loss for a great solution on the Macs. Here is what I want to happen:
Every Friday at something like 9PM, all Macs should go out to Apple's software update server, download every patch, and reboot if necessary. This should happen automatically and on a schedule without any user or administrator interaction.
We don't have a Mac OS X Server, and purchasing one probably won't be an option for some time. I do however have the latest version of Apple Remote Desktop.
Any help would be appreciated.
Best Answer
Scott's answer is essentially correct, but a better method would be the following command (see the
softwareupdate
man page for full details):The addition of
--schedule off
will prevent the machine from checking & notifying the user of new updates the rest of the time.&& /sbin/reboot
will restart the machine ifsoftwareupdate
finished without error.Also, I'd highly suggest that this be run from
launchd
for the sole reason that if the machine is asleep at the time it's supposed to fire, it'll be run as soon as the machine is woken up. It still won't fire off the job if the machine was off, but it's at least a little more intelligent thancron
.An example
launchd
plist file is as follows (see thelaunchd.plist
man page for further details) and would need to be saved in/Library/LaunchDaemons/
as something liketld.domain.asu_reboot.plist
:And the command would be put into a
bash
script in/usr/local/sbin/asu_reboot
(Apple Software Update Reboot) called by the abovelaunchd
plist, like so:With those two items in place (the
bash
script and thelaunchd
plist), you would run the following command to load the job (or reboot the machine and it'd load automatically):