[launchd-dev] [clamav] launchdaemon executes clamdscan several times when scanning

dev.admin at ntlworld.com dev.admin at ntlworld.com
Mon Dec 14 03:20:00 PST 2009


Hi,

Back to the original purpose of launchd...

I've installed clamav, 64bit, and wrote a LaunchDaemon to
execute once a day at a certain time on a certain volume.

However, when the LaunchDaemon executes, it seems to scan
the volume several times. At first I though it was clamav
but I then wrote a bash script that adds an entry to the
log file, executes clamdscan and then adds another log
entry.

Any ideas would be appreciated.

A.


LaunchDaemon
------------
<?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>Disabled</key>
	<false/>
	<key>Label</key>
	<string>net.clamav.clamdscan.app</string>
	<key>Program</key>
	<string>/Volumes/usr/arc_sys/scripts.bash/net.localhost.clamd.app.sh</ 
string>
	<key>StartCalendarInterval</key>
	<dict>
		<key>Hour</key>
		<integer>9</integer>
	</dict>
</dict>
</plist>

Bash script (net.localhost.clamd.app.sh)
----------------------------------------
#!/bin/bash
LOG=/Volumes/gnu/sec/var/log/clamav/clamd.log
APP=/Volumes/gnu/sec/usr/bin/clamdscan
OBJ=/Volumes/app
# append start timestamp to log
echo $(date "+%a %b %d %T %Y") "-> *** Started scanning:  $OBJ" >> $LOG
# start scan
/Volumes/gnu/sec/usr/clamav/bin/clamdscan $OBJ
# append finish timestamp to log
echo $(date "+%a %b %d %T %Y") "-> *** Finished scanning: $OBJ" >> $LOG

Log file (clamd.log)
--------------------
Mon Dec 14 09:00:00 2009 -> *** Started scanning:  /Volumes/usr
Mon Dec 14 09:13:53 2009 -> *** Finished scanning: /Volumes/usr
Mon Dec 14 09:13:54 2009 -> *** Started scanning:  /Volumes/usr
Mon Dec 14 09:28:06 2009 -> *** Finished scanning: /Volumes/usr
Mon Dec 14 09:28:06 2009 -> *** Started scanning:  /Volumes/usr
Mon Dec 14 09:41:27 2009 -> *** Finished scanning: /Volumes/usr
Mon Dec 14 09:41:27 2009 -> *** Started scanning:  /Volumes/usr
Mon Dec 14 09:54:55 2009 -> *** Finished scanning: /Volumes/usr
Mon Dec 14 09:54:55 2009 -> *** Started scanning:  /Volumes/usr
Mon Dec 14 10:00:00 2009 -> *** Started scanning:  /Volumes/app
Mon Dec 14 10:06:38 2009 -> *** Finished scanning: /Volumes/app
Mon Dec 14 10:06:38 2009 -> *** Started scanning:  /Volumes/app
Mon Dec 14 10:11:51 2009 -> *** Finished scanning: /Volumes/usr
Mon Dec 14 10:11:51 2009 -> *** Started scanning:  /Volumes/usr
Mon Dec 14 10:12:45 2009 -> *** Finished scanning: /Volumes/app
Mon Dec 14 10:12:45 2009 -> *** Started scanning:  /Volumes/app
Mon Dec 14 10:17:53 2009 -> *** Finished scanning: /Volumes/app
Mon Dec 14 10:17:53 2009 -> *** Started scanning:  /Volumes/app
Mon Dec 14 10:24:26 2009 -> *** Finished scanning: /Volumes/app
Mon Dec 14 10:24:26 2009 -> *** Started scanning:  /Volumes/app
Mon Dec 14 10:30:31 2009 -> *** Finished scanning: /Volumes/usr
Mon Dec 14 10:30:31 2009 -> *** Finished scanning: /Volumes/app
Mon Dec 14 10:30:31 2009 -> *** Started scanning:  /Volumes/usr
Mon Dec 14 10:44:22 2009 -> *** Finished scanning: /Volumes/usr
Mon Dec 14 10:44:22 2009 -> *** Started scanning:  /Volumes/usr
Mon Dec 14 11:02:02 2009 -> *** Finished scanning: /Volumes/usr
Mon Dec 14 11:02:02 2009 -> *** Started scanning:  /Volumes/usr
Mon Dec 14 11:15:38 2009 -> *** Finished scanning: /Volumes/usr



More information about the launchd-dev mailing list