sseenu79 0 Newbie Poster

Hi Unix Gurus,
I have written a shell script to unfreeze all frozen media in NetBackup. Here is the script written on HP-UX using ksh:
***********************************************

set -x
cd $HOME
rm -f frozentest
rm -f mediaserver
cd /usr/openv/netbackup/bin/admincmd
pbrun ./bpmedialist -summary | grep FROZEN | awk '{print $1 $2}' | grep FROZEN | cut -c 1-6 >>$HOME/frozentest
for i in `cat $HOME/frozentest`
do
    pbrun ./bpmedialist -m $i | grep Server | cut -f 4 -d " " > $HOME/mediaserver
      for j in `cat $HOME/mediaserver`
      do
              pbrun ./bpmedia -unfreeze -m $i -h $j
              echo "$i of $j has been unfreezed"
      done
done

***********************************************
This script should find all the frozen media and unfreeze them automatically. However the script is not working as expected. While running the last command (pbrun ./bpmedia -unfreeze -m $i -h $j) it is getting failed with "can't connect to client" error. I have written one more script using different logic even that is also getting failed with the same error. I am sure that there is no syntax errors in my logic and it could be something else which is failing the script. I am using ksh. Please let me know what could be the problem. Any suggestions on this would be greatly appreciated.

Thanks in Advance,
Srinivas Rao S.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.