Hi ,
I need help like to get errpt report everday to my mail....i got most of infor from other guy previous errpr script post ..but I need some changes in this
#!/bin/ksh
# Generate an error report (overview only) for yesterday 0:00h until today 0:00h
# yesterday's date in a format understandable by errpt
YDAY=$(LANG='En_US' perl -e 'print scalar localtime (time() - 86400)'|\
awk 'BEGIN{
mon["Jan"]=1; mon["Feb"]=2; mon["Mar"]=3; mon["Apr"]=4
mon["May"]=5; mon["Jun"]=6; mon["Jul"]=7; mon["Aug"]=8
mon["Sep"]=9; mon["Oct"]=10; mon["Nov"]=11; mon["Dec"]=12
}
{
print mon[$2] $3 "0000" substr($NF,3)
}')
# today's date in same format
TDAY=$(date +'%m%d0000%y')
# errpt call
echo errpt -s ${YDAY} -e ${TDAY}
errpt -s ${YDAY} -e ${TDAY} | mail -s " errors occured at hostname.checkout " XXXXXX@new.net
here this script will give us a errpt which will occur past 24 hours ( I think so ..) am I right ? …but even if no errors
occurs for past 24 hours also we get a blank mail with same subject, ..because this script don’t have a compare
stmt from prev to today date..so my head don’t want that kind so can anyone give me full script with compare stmt included..
thank you in advance..
waiting for reply's
regards,
scient