4

help with a shell script that greps an error from the logs

view full story
linux-howto

http://www.unix.com – Hello everyone. I wrote the following script but the second part is not excecuting. It is not sending the notification by email if the error occurs. the send mail is working so i think the errorr should be in the if statement Code: LOGDIR=/logs/out LOG=`date "+%Y%m%d"`.LOG-FILE.out #the log file TEMPDIR=/logs/out/test DATE=`date +"%d-%m-%Y"` TIME=`date +"%H:%M:%S"` CUR_SIZE=`wc -l $LOGDIR/$LOG | awk '{print $1}'` PREV_SIZE=`cat $TEMPDIR/log.size` if [ $CUR_SIZE -eq $PREV_SIZE ] then echo " Nothing to do..." > $TEMPDIR/log.diff fi if [ $CUR_SIZE - (HowTos)