Hi!

You said
"then  i add a crontab to run for ever 10 min 

crontab -e 
10 * * * * /your/location/of/script "

Please note that your syntax said to execute once per hour at the 10th minute 
of the hour

To execute at interval of 10 minutes, you may use the following line:
*/10 * * * * /your/location/of/script 

Cheers,
Eddy
  ----- Message d'origine ----- 
  De : Agnello George 
  À : Matt Kettler 
  Cc : Spamassassin 
  Envoyé : 7 mars 2008 07:27
  Objet : Re: script to send mail when error detected in log file


    > >
    > > Your inputs will be of great help
    > >
    > Might I suggest swatch? Why create your own script, when someone's
    > already created a powerful tool to do this.
    >
    > http://swatch.sourceforge.net/
    >
    > There's lots of good articles on using it out there:
    >
    > http://www.linuxsecurity.com/content/view/117281/50/
    > http://www.linuxjournal.com/article/4776

  I finally came up with my own script to do this 

  #!/bin/sh -x

  if [ $(tac  /var/log |grep -e "error: syswrite()"  | wc -l ) = 0 ] ; then
  exit 1
  else
  echo "your mailserver is down" |mail -s " pls check server ip 216.185.xxx.xxx 
" [EMAIL PROTECTED]
  fi
   
  then  i add a crontab to run for ever 10 min 

  crontab -e 
  10 * * * * /your/location/of/script 

   
   if there is an easier way kindly tell me !!!



   
    --
    Regards
    Agnello Dsouza
    www.linux-vashi.blogspot.com
    www.bible-study-india.blogspot.com




  -- 
  Regards
  Agnello Dsouza
  www.linux-vashi.blogspot.com
  www.bible-study-india.blogspot.com 

Reply via email to