#!/bin/sh MV_IDO=15 #Mintavetelezesi ido percben EV=`date "+%Y"` TSMSERVER="TSMSRV01" TSMUSER="userem" TSMPSWD="jelszavam" OUTF="/tmp/tsm_collect_tape_mounter_nodes.out" TMPF="/tmp/tsm_collect_tape_mounter_nodes.tmp" dsmadmc -id=$TSMUSER -pa=$TSMPSWD -se=$TSMSERVER -dataonly=y "q ac s='opened output volume' begint=-00:${MV_IDO}" | sed ':a;N;$!ba;s/\n//g' | sed "s/$EV/\n$EV/g" | sed 's/ / /g' | grep -Ev '(/|ANR2017I|ANR0513I|VP[0-9]{4})' | sed '1d' > $TMPF while read MOUNT; do echo $MOUNT | tee -a $OUTF SESSION=`echo $MOUNT | awk '{print $11}' | sed 's/[^0-9]//g'` if [ $SESSION ]; then dsmadmc -id=$TSMUSER -pa=$TSMPSWD -dataonly=y -commadel -displ=list -se=$TSMSERVER "q ac msgno=0406 se=$SESSION" | grep -v "^AN[RS]" | tee -a $OUTF echo "" | tee -a $OUTF fi done < $TMPF rm $TMPF