1. Community Tip: Please Give Thanks to Those Sharing Their Knowledge.
    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.
  2. Community Tip: Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING)
    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

Automaticly Backup Storage Pool Script*on AIX*

Discussion in 'Scripting' started by unpaired, Jun 12, 2012.

  1. unpaired

    unpaired ADSM.ORG Member

    Joined:
    Jun 17, 2010
    Messages:
    84
    Likes Received:
    1
    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
    **********************************************
     
  2.  

Share This Page