On Sun, 29 May 2005, Timothy Omer wrote:
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
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?
KISS -- Keep It Simple, Stupid
7-59/15 * * * * /usr/local/bin/freshclam --quiet
Cron will automagically email any output to the owner of the crontab.
And the --quiet means there won't be any output unless there's an error.
There's really no need for additional complexity here....
Damian Menscher
--
-=#| Physics Grad Student & SysAdmin @ U Illinois Urbana-Champaign |#=-
-=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801 Ofc:(217)333-0038 |#=-
-=#| 4602 Beckman, VMIL/MS, Imaging Technology Group:(217)244-3074 |#=-
-=#| <[EMAIL PROTECTED]> www.uiuc.edu/~menscher/ Fax:(217)333-9819 |#=-
-=#| The above opinions are not necessarily those of my employers. |#=-
_______________________________________________
http://lurker.clamav.net/list/clamav-users.html