====== Egy node adott objektumának kikeresése, van-e, melyik szalagon van ====== Adott nevű, útvonalú objektumot keres egy NODE mentései/archiválásai közt, majd ha létezik ilyen, kiírja, melyik táblában van, és milyen volume-on van letárolva. #!/bin/bash ID="userem" PSW="jelszavam" printf 'Keresett objektum nev (ll_name): '; read -r LL_NAME if [[ $LL_NAME ]]; then LL_NAME="and ll_name='$LL_NAME'"; fi printf 'Keresett objektum utvonal (hl_name): '; read -r HL_NAME if [[ $HL_NAME ]]; then HL_NAME="and hl_name='$HL_NAME'"; fi while [[ -z $NODE ]]; do printf 'Node neve: '; read -r NODE; done printf 'TSM szerver: '; read -r TSMSERVER echo '' echo '*** BACKUP TABLABAN: ***' while read -r SOR; do if [[ $SOR =~ 'ANR' ]]; then break; fi OBJ_ID=`echo $SOR | cut -f1 -d","` echo -E "Objektum: "`echo -E $SOR | cut -f2,3,4 -d","` echo -E "Mentes datuma: "`echo -E $SOR | cut -f5 -d","` dsmadmc -se=${TSMSERVER:-tsmserverem} -id=$ID -pa=$PSW -dataonly=y -displ=tabl "show bfo $OBJ_ID" | grep -E '(Type|Volume)' | grep -o "...e: [A-Z0-9]*[^A-Z0-9]*" echo done <<< "`dsmadmc -se=${TSMSERVER:-tsmserverem} -id=$ID -pa=$PSW -dataonly=y -displ=list -commadel "select object_id, FILESPACE_NAME, HL_NAME, LL_NAME, BACKUP_DATE from backups where node_name=upper('$NODE') $HL_NAME $LL_NAME"`" echo '' echo '*** ARCHIVES TABLABAN: ***' while read SOR; do if [[ $SOR =~ 'ANR' ]]; then break; fi OBJ_ID=`echo $SOR | cut -f1 -d","` echo -E "Objektum: "`echo -E $SOR | cut -f2,3,4 -d","` dsmadmc -se=${TSMSERVER:-tsmserverem} -id=$ID -pa=$PSW -dataonly=y -displ=tabl "show bfo $OBJ_ID" | grep -E '(Type|Volume)' | grep -o "...e: [A-Z0-9]*[^A-Z0-9]*" echo done <<< "`dsmadmc -se=${TSMSERVER:-tsmserverem} -id=$ID -pa=$PSW -dataonly=y -displ=list -commadel "select object_id, FILESPACE_NAME, HL_NAME, LL_NAME from archives where node_name=upper('$NODE') $HL_NAME $LL_NAME"`"