Hello everyone,

 

I have been asking on the forms and trying to solve this problem for a few
weeks now - I hope you can help me.

 

>From cron I run freshclam every 4 hours with the following command.

 

15 */4 * * */usr/local/bin/freshclam --quiet || mail -s "There has been an
error updating ClamAV on the Office Server" [EMAIL PROTECTED] <
/var/log/clamav/freshclam.log

 

.when there is an update I get no email, but when there is no updates I get
an email (I take it that freshclam exits with an non 0 exit code and this
results in me getting an email).

 

Im sure that many of you must have a similar setup, how do you get cron to
only send an email when freshclam exits with an error code? Is there a way
to check the error code first in cron? (I have also tried the
-on-error-execute command, but I have been unable to get it to successfully
send the email, I just get an error that says "-s is an unknown parameter".
-s is for the subject of the mail, but freshclam seems to think that it is
for itself)

 

Many thanks,

Tim

_______________________________________________
http://lurker.clamav.net/list/clamav-users.html

Reply via email to