launchctl: StartInterval vs ThrottleInterval

Reposting from: http://discussions.apple.com/message.jspa?messageID=11982593

Hi everyone.

I'm attempting to automate a file transver via shell script and ideally I would like it to run once every 10~15 minutes. Most of the time this script will find nothing to do and exit 0 within 5 seconds of being called.

Initially I created a very barebones plist and placed it in ~/Library/LaunchAgents. I set StartInterval to 600 and loaded the plist and confirmed it was running via launchctl list | grep com.mydomainname. But the log file the script creates showed that the shell was running *every 10 seconds*. Not good.

After some research here it seems like the default throttle for a job is 10 seconds. So I then added ThrottleInterval of 900 to the plist, reloaded, and now things work well.

If anyone can clarify why StartInterval is ignored or not recognized in the initial case, I'd appreciate it. Thanks in advance.

For reference, here is the initial plist with the ignored StartInterval:

<pre>
<?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.mydomain.myscriptname</string>
<key>ProgramArguments</key>
<array>
<string>/Users/kyle/Desktop/Tools/myscriptname.sh</string>
</array>
<key>OnDemand</key>
<false/>
<key>Nice</key>
<integer>1</integer>
<key>KeepAlive</key>
<false/>
<key>RunAtLoad</key>
<false/>
<key>StartInterval</key>
<integer>600</integer>
</dict>
</plist>
</pre>

Mac OS X (10.6.4)

Posted on Jul 26, 2010 7:03 AM

Reply
1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

launchctl: StartInterval vs ThrottleInterval

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.