
# Check volumes for old snapshots
# 20071001, RtB

rm -f /tmp/check_snapshot.log

for VOL in `ssh hwnaf01 vol status | grep ec_vault | awk '{print $1}' | sort`
do
SVNUM=`ssh hwnaf01 snap list ${VOL} | grep vault | grep -c base`
SMNUM=`ssh hwnaf01 snap list ${VOL} | grep vault | grep -v Vol | grep -c -v base`

if test ${SVNUM} -gt 2
then
   echo "Too many snapvault bases on volume ${VOL} \n"  >> /tmp/check_snapshot.log
fi
if test ${SMNUM} -gt 1
then
   echo "Too many snapmirror bases on volume ${VOL} \n" >> /tmp/check_snapshot.log
fi
done

if test -f /tmp/check_snapshot.log
then
   cat /tmp/check_snapshot.log # | mailx -s ":hwnaf01: old snapshots" gmnl-msscentral@atosorigin.com
fi

