Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Run Anacron via launchd' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Run Anacron via launchd
Authored by: matamatangi on May 19, '05 11:16:20AM
Cron is indeed started at boot: cat /System/Library/LaunchDaemons/com.vix.cron.plist

<?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.vix.cron</string>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/sbin/cron</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>WatchPaths</key>
        <array>
                <string>/etc/crontab</string>
        </array>
        <key>QueueDirectories</key>
        <array>
                <string>/var/cron/tabs</string>
        </array>
</dict>
</plist>
------ I believe the system cron *entries* may not survive the update, but those are easy enough to recreate. Plus, you really shouldn't add stuff to the system crontab, but rather to root's crontab (sudo crontab -e).

[ Reply to This | # ]
10.4: Run Anacron via launchd
Authored by: jpbjpbjpbjpb on May 19, '05 12:55:41PM

Yeah, there's a plist file for cron, but on my laptop, ps showed that cron wasn't actually getting loaded, or at least it wasn't running.

I installed as an upgrade, though, not a clean install, but that shouldn't have made a difference.



[ Reply to This | # ]
10.4: Run Anacron via launchd
Authored by: fungus on May 19, '05 04:18:10PM
Of course it isn't running. launchd is smart enough to only run it when there actually is a crontab for it to use. from launchd.plist(5) manpage:
WatchPaths
<array of strings>
This optional key causes the job to be started if any one of the listed paths are modified.
QueueDirectories
<array of strings>
Much like the WatchPaths option, this key will watch the paths for modi- fications. The difference being that the job will only be started if the path is a directory and the directory is not empty.


[ Reply to This | # ]