Dear Apple: Fix launchd, document please?
Friday, 6 March 2009 10:57 amApparently, cron is deprecated in OSX 10.5.
K, fine. But its replacement, launchd, is a crappy replacement. It has no concept of time ranges (Or does it? Any mac folks with insight to share here?)
I want to replicate this crontab:
So, run every 20 minutes between 8am and5pm 5:40pm.
My preferred answer is to get my crontab entry working, but /var/log/system.log is reporting errors such as Mar 6 10:20:00 scsmac21 com.apple.launchd[1] (0x1000000.cron[64942]): Could not
setup Mach task special port 9: (os/kern) no access.
Googling finds reports of this same problem and error-message with no solutions offered.
[Edit to add: that error was actually a warning; hiding a $PATH problem that wasn't emailed to me as cron-job errors should be. :-P But it's working now, no help from the OS...]
Google also finds a pile of howtos for launchd from 2005-2006, saying "well, it's not as flexible as cron, but give it time, it's only 1.0." Apple, fix your software!
...I guess I'm stuck with dropping the "8am-5pm" part of it, and writing a launchd plist:
There, isn't that so much easier?... :-P
Bleh.
K, fine. But its replacement, launchd, is a crappy replacement. It has no concept of time ranges (Or does it? Any mac folks with insight to share here?)
I want to replicate this crontab:
0,20,40 8-17 * * * /users/drallen/bin/thing.sh
So, run every 20 minutes between 8am and
My preferred answer is to get my crontab entry working, but /var/log/system.log is reporting errors such as Mar 6 10:20:00 scsmac21 com.apple.launchd[1] (0x1000000.cron[64942]): Could not
setup Mach task special port 9: (os/kern) no access.
Googling finds reports of this same problem and error-message with no solutions offered.
[Edit to add: that error was actually a warning; hiding a $PATH problem that wasn't emailed to me as cron-job errors should be. :-P But it's working now, no help from the OS...]
Google also finds a pile of howtos for launchd from 2005-2006, saying "well, it's not as flexible as cron, but give it time, it's only 1.0." Apple, fix your software!
...I guess I'm stuck with dropping the "8am-5pm" part of it, and writing a launchd plist:
<?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>scsmac21</string>
<key>UserName</key>
<string>drallen</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/some_program</string>
<string>param1</string>
<string>param2</string>
</array>
<key>StartInterval</key>
<integer>300</integer>
</dict>
</plist>
There, isn't that so much easier?... :-P
Bleh.