image
image

|


Go Back   macosx.com > Mac Help Forums > Mac OS X System & Mac Software

Reply
 
Thread Tools
  #9  
Old November 28th, 2007, 03:57 PM
Whitehill's Avatar
Registered User
 
Join Date: May 2005
Location: Maine
Posts: 157
Thanks: 0
Thanked 0 Times in 0 Posts
Whitehill is on a distinguished road
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.
__________________
iMac 24" 3.06 Ghz Intel Core 2 Duo, 4 gb, 1 tb
Reply With Quote
  #10  
Old November 29th, 2007, 04:48 AM
Whitehill's Avatar
Registered User
 
Join Date: May 2005
Location: Maine
Posts: 157
Thanks: 0
Thanked 0 Times in 0 Posts
Whitehill is on a distinguished road
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?
__________________
iMac 24" 3.06 Ghz Intel Core 2 Duo, 4 gb, 1 tb
Reply With Quote
  #11  
Old November 29th, 2007, 12:59 PM
Whitehill's Avatar
Registered User
 
Join Date: May 2005
Location: Maine
Posts: 157
Thanks: 0
Thanked 0 Times in 0 Posts
Whitehill is on a distinguished road
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?
__________________
iMac 24" 3.06 Ghz Intel Core 2 Duo, 4 gb, 1 tb
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 09:12 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.