# Leopard user crontab!



## Zimbop (Nov 10, 2007)

Where did they move the leopard user crontab?!

I just can't find it


----------



## Zimbop (Nov 10, 2007)

found it...

/usr/lib/cron/tabs


----------



## Whitehill (Nov 28, 2007)

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?


----------



## Giaguara (Nov 28, 2007)

How to make cron behave? Know what you are doing when you touch it...
(and even then, don't touch it)


----------



## Whitehill (Nov 28, 2007)

Would you suggest an alternative?


----------



## Giaguara (Nov 28, 2007)

Depends on what you need to achieve.


----------



## Whitehill (Nov 28, 2007)

Call fetchmail every few minutes.
Invoke backups daily, weekly, monthly.
That kind of stuff.


----------



## Giaguara (Nov 28, 2007)

Hm, then cron ...
Or OnyX allows you to add stuff to periodic if I remember correctly. (and run it anytime)


----------



## Whitehill (Nov 28, 2007)

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.


----------



## Whitehill (Nov 29, 2007)

I have eliminated a lot of the clutter from the console log.  The following may have something to do with my cron problems:

```
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?


----------



## Whitehill (Nov 29, 2007)

I got rid of the log entries.  First, remove this line from user whitehill's crontab:

```
*/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

```
<?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

```
launchctl load /Library/LaunchAgents/net.home.some.whitehill.plist
```
Wow!  Isn't that so much simpler and easier?


----------



## mitchenall (Jan 22, 2009)

i'm getting the same thing... would love to know what's causing it.


----------

