############################################################# # ugwatch - Watch source and target tables while upgrade # Copy jobs are running # J. David Schronce ############################################################# sourcepline=prod8 targetpline=prod ############################################################# src_count=/tmp/$sourcepline.count umask 000 if [ ! -s $src_count ]; then echo "$sourcepline count file does not exist - Creating..." count $sourcepline > $src_count fi while : ; do pgmcount=0 for table in `jqstatus -a | sort -nr +8 | cut -d, -f2` ; do src=`grep "^$table " $src_count | awk '{print $2}'` if [ `grep -c "^$table " $src_count` -eq 0 ]; then : else pgmcount=1 echo "Counting $table..." tgt=`count $targetpline $table | awk '{print $2}'` pct=`echo "scale=2;($tgt / $src)*100" | bc | cut -d"." -f1` echo " $sourcepline $src \c" echo " $targetpline $tgt \c" echo " Percent Complete: $pct%" date '+%H:%M:%S' echo " " fi done echo "`jqstatus -w | grep "Waiting" | wc -l` upgrade jobs in Waiting queue" echo "`jqstatus -w | grep "Needs" | wc -l` upgrade jobs in Needs Recovery" echo " " echo "\n ----------------------\n" if [ $pgmcount -eq 0 ]; then echo "No COPY jobs to report - exitting..." exit fi done