Nobody had an answer for me, so maybe you missed my post. So I'll re-post...

I've encountered something weird here. I made a script, to use with cron.
Here's what it looks like:

#!/bin/bash
BAK1=""
BAK2=""
BACK=""
EXCL=""

BAK1=`date +%m%d%Y`
BAK2=`date +%H%M`
BACK=`echo clam_${BAK1}_${BAK2}`

EXCL='--exclude=Mailbox --exclude=/home/httpd --exclude=/home/admin --exclude=/d
ev --exclude=/extra --exclude=/proc --exclude=/var --exclude=/home/clamav/quaran
tine --exclude=/root/installed'

/usr/local/bin/clamscan -l /home/clamav/logs/$BACK.log -r -i --mbox --move=/home
/clamav/quarantine $EXCL --max-files=25 --max-space=25 --max-recursion=5 /

I'm running this script from my cron like so:

30 3 * * * /usr/local/bin/clamav.sh

When I run the script manually from the command line (and have no viruses) the
only output that I get is the end-summary.

----------- SCAN SUMMARY -----------
Known viruses: 20403
Scanned directories: 9315
Scanned files: 97841
Infected files: 0
Data scanned: 1392.87 MB
I/O buffer size: 131072 bytes
Time: 3456.558 sec (57 m 36 s)

When this script runs in the cron, I get the following output mailed to me
(from cron):

//proc/10422/cmdline: Excluded (/proc).
//proc/10422/stat: Excluded (/proc).
//proc/10422/statm: Excluded (/proc).
//proc/10422/maps: Excluded (/proc).
//proc/10422/mem: Excluded (/proc).

----------- SCAN SUMMARY -----------
Known viruses: 20403
Scanned directories: 9315
Scanned files: 97841
Infected files: 0
Data scanned: 1392.87 MB
I/O buffer size: 131072 bytes
Time: 3456.558 sec (57 m 36 s)

Keep in mind, that there are HUNDREDS of files before this, all in /proc
With the -i option, I should'nt get any output except infected files, and
the end-summary.

So what's the problem here? 
Why does it act differently if run from the command line, than from cron?
Why does it ignore the -i option, but only for /proc, when I have many 
files (directories) '--exclude'ed, not just /proc?

This seems to be very strange behavior.

Sincerely,

Gordon E.


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users

Reply via email to