The script backup your from primary stg pool to copy stg pool and then it will inform you


*******************WDIR=/usr/local/scripts
LOGFILE=$WDIR/tsm_stgbackup_kontrol.out
MFILE=/tmp/tsm_stgbackupdurum.out.$$
>/tsm_stgbackup_kontrol.out
for i in 1 2 ;do

if [ $i -eq 1 ]
then
SAAT=`date "+%H:%M"`
echo $HOUR
tape=TS3310_ARCHIVEPOOL
dsmadmc -id=admin -password="xxx" "backup stgpool TS3310_ARCHIVEPOOL COPY_TS3310_ARCHIVEPOOL"
sleep 60
dsmadmc -id=admin -password="xxx" "q actlog begint=$HOUR endt=now"> $WDIR/tsm_stgbackup_kontrol.out
else
HOUR=`date "+%H:%M"`
echo $HOUR
tape=TS3500_ARCHIVEPOOL
dsmadmc -id=admin -password="xxx" "backup stgpool TS3500_TAPE_ARCHIVEPOOL COPY_TS3500_TAPE_ARCHIVEPOOL"
sleep 60
dsmadmc -id=admin -password="xxx" "q actlog begint=$HOUR endt=now"> $WDIR/tsm_stgbackup_kontrol.out
fi



echo "From: Tsm Admin <root@xxx.vakifbank.com>" > $MFILE

count1=`egrep "ANR2111W" $WDIR/tsm_stgbackup_kontrol.out | wc -l `
if [ $count1 -gt 0 ]
then
echo "Subject: TSM $tape BACKUP KOPYALANACAK DATA YOKTUR" >> $MFILE
echo "To: abc.cdg@xxx.com.tr" >> $MFILE
echo "Content-type: text/html; charset=US-ASCII" >> $MFILE
echo "Content-transfer-encoding: 7BIT" >> $MFILE
echo "" >> $MFILE
echo "<HTML><BODY><PRE>" >> $MFILE
echo "$tape No Data Arsiv Poolda !" >> $MFILE

else


count=`egrep "SUCCESS|ANR0986I" $WDIR/tsm_stgbackup_kontrol.out | wc -l `
if [ $count -gt 0 ]
then
echo "Subject: TSM $tape BACKUP SUCCESS" >> $MFILE
else
echo "Subject: ERROR!! TSM $tape BACKUP FAILED" >> $MFILE
fi

echo "To: abc.cdf@xxx.com.tr" >> $MFILE
echo "Content-type: text/html; charset=US-ASCII" >> $MFILE
echo "Content-transfer-encoding: 7BIT" >> $MFILE
echo "" >> $MFILE
echo "<HTML><BODY><PRE>" >> $MFILE
if [ $count -gt 0 ]
then
echo "$tape Arsiv Pool Backups Success!" >> $MFILE
else
echo "Hata: $tape Arsiv Pool Backuplas Fail. Run the again">> $MFILE
fi

fi

echo "</PRE></BODY></HTML>" >> $MFILE
sendmail -t < $MFILE

#/usr/bin/rm -f $LOGFILE

done
**********************************************