This page looks plain and unstyled because you're using a non-standard compliant browser. To see it in its best form, please upgrade to a browser that supports web standards. It's free and painless.

Paul's Time Sink

| Main | Albums |

« | »

cron jobs with launchd

Paul Westbrook | 24 August, 2005 21:12

In this post, I described ClamXav and how it will install a cron job to scan files as well as updating the virus definitions.  In Mac OS X 10.4, Apple has created launchd to replace crond, init, and xinitd.  So I wanted to replace with the cron jobs with Launch Actions.

Here are the plist files that I have created to replace the cron jobs.  I created these plist files with Launchd Editor, I wasn't able to get the scripts to work when I created them with Property List Editor

<?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>GroupName</key>
<string>clamav</string>
<key>Label</key>
<string>com.pwestbro.clamXavUpdate</string>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>Program</key>
<string>/usr/local/clamXav/bin/freshclam</string>
<key>ProgramArguments</key>
<array>
<string>--quiet</string>
<string>--log="/usr/local/clamXav/share/clamav/freshclam.log"</string>
</array>
<key>ServiceDescription</key>
<string>ClamXav Update run</string>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>11</integer>
<key>Minute</key>
<integer>30</integer>
</dict>
<key>UserName</key>
<string>clamav</string>
</dict>
</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.pwestbro.clamXav</string>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>Program</key>
<string>/usr/local/clamXav/bin/clamscan</string>
<key>ProgramArguments</key>
<array>
<string>-r</string>
<string>--log="/Users/pwestbro/Library/Logs/clamXav-scan.log"</string>
<string>--exclude=sit$</string>
<string>--exclude=sitx$</string>
<string>--exclude=dmg$</string>
<string>/Users/pwestbro/Documents</string>
</array>
<key>ServiceDescription</key>
<string>ClamXav scan run</string>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>12</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
</dict>
</plist>


[via TUAW]

Technorati Tags: , ,

Add comment

Topic

Text

Your name

Your email address

Your personal page (if any)




Powered by LifeType
Design by Book of Styles