Leopard user crontab!

Well, this is a surprise. I upgraded from 10.4.11 (server) to 10.5 and then 10.5.1. I have tabs in /var/cron/tabs and duplicates in /usr/lib/cron/tabs, really /var/at/tabs. OK, now I know where things are. But ...

cron is running jobs only for me (the administrator) and is ignoring other users. And, yes, the files at.deny and cron.deny in /var/at are empty.

Any ideas how to make cron behave?
 
How to make cron behave? Know what you are doing when you touch it...
(and even then, don't touch it)
 
Hm, then cron ...
Or OnyX allows you to add stuff to periodic if I remember correctly. (and run it anytime)
 
It took me most of the day to research how this works. The ultimate daemon is launchd which runs cron and at periodically. That said, I still can't explain why jobs for some users get run, for others they get ignored.
 
I have eliminated a lot of the clutter from the console log. The following may have something to do with my cron problems:
Code:
11/29/07 5:40:00 AM com.apple.launchd[1] (0x1121b0.cron[8270]) Could not setup Mach task special port 9: (os/kern) no access 
11/29/07 5:40:00 AM com.apple.launchd[1] (0x110b30.cron[8271]) Could not setup Mach task special port 9: (os/kern) no access
Anyone know what this means?
 
I got rid of the log entries. First, remove this line from user whitehill's crontab:
Code:
*/5 * * * * /usr/bin/some_program param1 param2
That is, run the program every 5 minutes every day.

Now, create the file /Library/LaunchAgents/net.home.some.whitehill.plist with contents
Code:
<?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>net.home.some.whitehill</string>
        <key>UserName</key>
        <string>whitehill</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>

Then run
Code:
launchctl load /Library/LaunchAgents/net.home.some.whitehill.plist
Wow! Isn't that so much simpler and easier? :mad:
 
Back
Top