On Tue, Mar 4, 2008 at 3:39 AM, Agnello George agnello.dsouza@gmail.com 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" agnello.dsouza@gmail.com 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-notificatio...
regards VK