How to run a nightly backup job on Snow Leopard Server via launchd I have been trying to configure a nightly backup job on my Mac Mini server, and after a lot of Googling and digging and man-page'ing, I figured out that launchd seemed to be the correct too, and tried setting up my own plist fil. I've come up with this (stored in /Library/LaunchDaemons/dk.revealit.NightlyRSyncBackup.plist):

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
        &lt;key&gt;Label&lt;/key&gt;
        &lt;string&gt;dk.revealit.NightlyRSyncBackup&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;/var/root/run-rsync&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;LowPriorityIO&lt;/key&gt;
        &lt;true/&gt;
        &lt;key&gt;Nice&lt;/key&gt;
        &lt;integer&gt;1&lt;/integer&gt;
        &lt;key&gt;WorkingDirectory&lt;/key&gt;
        &lt;string&gt;/var/root&lt;/string&gt;
        &lt;key&gt;RunAtLoad&lt;/key&gt;
        &lt;false/&gt;
        &lt;key&gt;StartCalendarInterval&lt;/key&gt;
        &lt;dict&gt;
                &lt;key&gt;Hour&lt;/key&gt;
                &lt;integer&gt;3&lt;/integer&gt;
                &lt;key&gt;Minute&lt;/key&gt;
                &lt;integer&gt;15&lt;/integer&gt;
        &lt;/dict&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Problem is, it doesn't work. I can load it with launchctl, and it appears on launchctl list with exit status 0. But if I check my backup files, they are not updated.

Any clues as to what I'm doing wrong (assuming my backup script works as it should)?
Several things come to mind:


Did you wait overnight for it to run?  launchctl load won't make it run out of sequence -- if you want to make it run at some time other than 3:15 am, use sudo launchctl start dk.revealit.NightlyRSyncBackup after it's loaded.
Does the run-rsync script fire off any background processes, or does it do everything inline?  'Cause if the script exits and there are background processes still going, launchd thinks something has gone wrong and kills the background processes.  If you don't want it to do this, add &lt;key&gt;AbandonProcessGroup&lt;/key&gt;&lt;true/&gt; to the .plist.
Does the script depend on PATH including any nonstandard directories (e.g. /opt/local/bin or something like that)?


One useful debugging technique is to add something like:

&lt;key&gt;StandardOutPath&lt;/key&gt;
&lt;string&gt;/var/root/NightlyRSyncBackup.out&lt;/string&gt;
&lt;key&gt;StandardErrorPath&lt;/key&gt;
&lt;string&gt;/var/root/NightlyRSyncBackup.err&lt;/string&gt;


to the .plist and see what shows up in those files.