Need assistance troubleshooting / learning launchctl and plist I've always been a crontab guy. Recently I have decided to make the switch to Apple's launchd processes, and I am unable to get my first plist to run.


The plutil -lint command tells me the plist is formatted correctly. Actually, it outputs "OK".
I have run the bash script manually and confirmed that it properly operates when manually initiated.
I have loaded the file using launchctl load and received the response "already loaded" on repeated attempts to do the same.


The problem must be in my PLIST definition.  Please help me spot the error.

I expect this to run with the following conditions:


Only while the user jaredclemence is using the system
Once immediately on login
Every 15 minutes thereafter
Change Directory to /Library/WebServer/Documents/medface/ before running the script.


The plist file is as follows:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//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;org.pediatricheartcenter.medface.crons&lt;/string&gt;
        &lt;key&gt;User&lt;/key&gt;
        &lt;string&gt;jaredclemence&lt;/string&gt;
        &lt;key&gt;ProgramArguments&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;/User/jaredclemence/runMedfaceSchedTasks.batch&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;WorkingDirectory&lt;/key&gt;
        &lt;string&gt;/Library/WebServer/Documents/medface&lt;/string&gt;
        &lt;key&gt;StartInterval&lt;/key&gt;
        &lt;integer&gt;900&lt;/integer&gt;
        &lt;key&gt;RunAtLoad&lt;/key&gt;
        &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Notes:


I have stored the file in ~/Library/LaunchAgents/org.pediatricheartcenter.medface.crons.plist
A previous version of the file used Program instead of ProgramArguments with a &lt;string&gt; value instead of an array.
Launchd writes errors to system.log.  Using Console, I viewed the log. There, launchd told me that it did not like my User key value.  I removed the User - jaredclemence key-value pair, and loaded the plist again. It then told me the batch program did not exist and I then noticed the error in the file path.  /User should be /Users

By removing the User setting and correcting the file path, I was able to fix the problem. Now, running ps -ef | grep 'runMed', I am able to see that the batch file is currently executing.

SUCCESS!