running launchd scripts on interval basis
StartInterval <integer>
This optional key causes the job to be started every N seconds. If the system is asleep, the job will
be started the next time the computer wakes up. If multiple intervals transpire before the computer is
woken, those events will be coalesced into one event upon wake from sleep.
But for me, when I type in "launchctl load <plist file name>" it just runs once and never again. By the way, I also have the problem of getting this to run at startup on it's own (that's why I'm doing it manually for now) but since I can't even get the script to run properly, that is an issue I'll have to address later.
The script I am trying to run checks the timestamp of an image file and is supposed to reboot the program if it's not updating. Here is the plist file which is supposed to run the script every 5 min. What am I doing wrong with it?
<?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.sns.sentinel.monitor</string>
<key>KeepAlive</key>
<false/>
<key>StartInterval</key>
<integer>300</integer>
<key>WorkingDirectory</key>
<string>/Applications/oc4j/</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>./keepRunning.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>root</string>
</dict>
</plist>