Hi All
I am working with db2 v8.2 and aix 5.3
I am trying to write a shell script to check db2diag.log for Severe error and email to dba, I wrote as follow
#! /usr/bin/ksh
. /home/dba/.profile
SCRDIR=/home/dba
cd $SCRDIR
. ~insti1/sqllib/db2profile
TIMESTAMP=`date +%Y-%m-%d.%H:%M
LOGFILE="/home/dba/DBBOX-db2diag.$TIMESTAMP"
db2diag -g db:= -gi LEVEL=Severe >> $LOGFILE
cat $LOGFILE | mail -s "Checking error @ $( hostname )
--DBA@xxx.com $TIMESTAMP"
it works manually fine but when I put the job on crontab to check every 5 minutes and send email, always LOGFILE is empty
Please help I rid off this issue .
Thanks