I'm trying to set up a simple repeating task with launchd on OS X. My plist file is in /Users/me/Library/LaunchAgents and all I want it to do is run the command node --version
. My plist file looks like this:
<?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>Label</key>
<string>com.blah.testnode</string>
<key>ProgramArguments</key>
<array>
<string>node</string>
<string>--version</string>
</array>
<key>StartInterval</key>
<integer>300</integer>
</dict>
</plist>
It printed out the right response when I ran launchctl load com.blah.testnode.plist
but now it looks like each subsequent execution is giving me the following error:
8/24/14 1:54:03.845 PM com.apple.launchd.peruser.501[251]: (com.blah.testnode[36483]) Job failed to exec(3). Setting up event to tell us when to try again: 2: No such file or directory
8/24/14 1:54:03.845 PM com.apple.launchd.peruser.501[251]: (info.jayharris.testnode[36483]) Job failed to exec(3) for weird reason: 2
Does anybody know how to get this to work? Thanks.