Automating Software Updates with launchd

Discussion in 'Mac Programming' started by viggen9, Dec 20, 2007.

  1. viggen9 macrumors member

    Oct 18, 2004
    Hello. I'm trying to get launchd to act like cron and execute a script on Friday afternoons to install software updates (education environment). My shell script works fine, but I can't get launchd to launch it at a specific time.

    I am using:
    sudo launchctl load com.sps.autoupdate.plist which runs my script immediately instead of at the time specified within the plist. Any ideas as to how to correctly format the plist? Here it is:

    ?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN >
    <plist version="1.0">

    Thanks for your help---
  2. CANEHDN macrumors 6502a


    Dec 12, 2005
    Eagle Mountain, UT
    And why not just have Apple Updates update automatically?
  3. viggen9 thread starter macrumors member

    Oct 18, 2004
    Because this is for hundreds of Macs in an education environment.
  4. Krevnik macrumors 68040


    Sep 8, 2003
    The big thing I see is that you don't actually specify a path to your script.


    The script also needs to be set executable, owned by root, and have had group/everyone permissions for r/w stripped (launchd doesn't like launching jobs as root that can be writable by a normal user, as it is a security risk).
  5. tjwett macrumors 68000


    May 6, 2002
    Brooklyn, NYC
    Deploying Updates...

    hey viggen9. i cannot help you with your script but i can tell you how i do it. i maintain about 300 Macs for a large newspaper and i've grown tired of trying to reliably automate the installations on the client machines. this is the method i've settled upon and it's been working great.

    we have an XServe running Software Update services and all of the clients are set via Workgroup Manager to use this for updates. so i have the server set to mirror all updates from Apple, but not enable automatically. when i want to deploy an important update i just enable it on the server. i have ARD running the Unix command "softwareupdate -i -a" as root on every machine on the network twice per day and i simply have each machine have a scheduled reboot every night after hours, via Workgroup Manager as well.
  6. aperkins macrumors newbie

    Jun 4, 2012
    ARD Still a great solution in 2012

    We were spinning our wheels trying to create client-side solutions as well. tjwett's solution using Apple Remote Desktop (ARD) works flawlessly. Maybe once we've gotten all the Windows updates, deployments, debugging, etc. completed we can try a client side solution again, but until then... :apple:

Share This Page