On Tue, Mar 4, 2008 at 3:39 AM, Agnello George <[EMAIL PROTECTED]> wrote: > HI > > I have a small query !! I need to write a script whenever there is an > error generated in the spamd.log or any general log file to send me a > mail only once, the bellow script is what i came u with but i doubt it > would work. > > if [ $(grep -e "unable to start service" /var/log/spamd.log) = 1 ] ; then > mail -s " pls check server IP 203.185.XXX>XXX" [EMAIL PROTECTED] > fi
You are almost there. For synchronous emailing you will need to un the script as a daemon. Have a look at this blog post for more details http://www.johnandcailin.com/blog/john/how-setup-real-time-email-notification-critical-syslog-events regards VK -- http://mm.glug-bom.org/mailman/listinfo/linuxers

