Differences between revisions 1 and 2
Deletions are marked like this. Additions are marked like this.
Line 59: Line 59:
replacing of course the proper path to your plist file. If you type 'list', you should see 'DevNightlyBuild' in the list. replacing of course the proper path to your plist file. If you type 'list', you should see '!DevNightlyBuild' in the list.


launchd


This page describes how the Mac daemon 'launchd' is used to automatically run the nightly build on the Leopard Intel Mac platforms.

In the past, a standard 'cron' job was used to run the nightly build script (as is done on the Linux build platforms), but beginning with the Leopard release, cron no longer seems to work. Apple strongly recommends using their 'launchd' daemon to run stuff like this, so be it.

launchd needs a plist file to describe the task. Here are the contents of a file named 'DevNightlyBuild.plist', created using the utility Launchd Editor (but a text editor will suffice):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>GroupName</key>
        <string>fsdev</string>
        <key>Label</key>
        <string>DevNightlyBuild</string>
        <key>Program</key>
        <string>/space/freesurfer/build/scripts/build_dev.csh</string>
        <key>ProgramArguments</key>
        <array>
                <string>&amp;</string>
        </array>
        <key>ServiceDescription</key>
        <string>nightly build of dev enviro</string>
        <key>StartCalendarInterval</key>
        <dict>
                <key>Hour</key>
                <integer>4</integer>
                <key>Minute</key>
                <integer>0</integer>
        </dict>
        <key>UserName</key>
        <string>nicks</string>
</dict>
</plist>

This should execute the script /space/freesurfer/build/scripts/build_dev.csh at 4:00AM each day.

This file is stored in the directory $HOME/Library/LaunchAgents.

To activate it, run launchctl:

 launchctl

launchd%

which brings up the launchd prompt. Type 'help' to show commands. To load the plist, type:

launchd% load /homes/11/nicks/Library/LaunchAgents/DevNightlyBuild.plist

replacing of course the proper path to your plist file. If you type 'list', you should see 'DevNightlyBuild' in the list.

The script should run a 4:00AM. Check /var/log/system.log for errors.

MacOsLaunchd (last edited 2008-06-07 21:10:57 by NickSchmansky)