launchd does not run scheduled tasks

I can not get launchd to make any scheduled tasks. If I copy the com.apple.periodic-daily.plist to /Library/LaunchDaemons/com.apple.fileList-daily.plist and edit the script and time e.g:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.fileList-daily</string>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>/Users/admin/Documents/scripts/list_files.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>17</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
</dict>
</plist>
I load this daemon with sudo launchctl load /Library/LaunchDaemons/com.apple.fileList-daily.plist
This should run the script list_files.sh at 17:15. However this never happens. If I run the daemon using launchctl start com.apple.fileList-daily then the script is run suggesting that the plist file is correct. However the scheduled job never works.

Any ideas? Many thanks

mac mini, Mac OS X (10.4.5)

Posted on Mar 2, 2006 10:19 AM

Reply
1 reply

Mar 2, 2006 5:51 PM in response to Anthony Underwood

Hi Anthony,
There's nothing wrong with the property list that I can see; as you said, it's virtually copied from one that works. The fact that the job runs when you start it with launchctl suggests that it's not an issue with the environment, although I assume there's still a small possibility of that being an issue.

My best guess is that you are loading the job too close to the time it's supposed to run. You should load it more than an hour beforehand. I'm not sure of the cause of the problem but there have been enough reports to suggest that the lead time is required.
--
Gary
~~~~
I believe a little incompatibility is the spice of life,
particularly if he has income and she is pattable.
-- Ogden Nash

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.

launchd does not run scheduled tasks

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