| | |
Shell Script fails with "can't connect to client"
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2006
Posts: 1
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- Sending email from a shell script (Shell Scripting)
- How to su properly in a shell script (Shell Scripting)
- Convert shell script for looping (Shell Scripting)
- shell script as a daemon (Shell Scripting)
- Problem with variables in Windows shell script (Windows NT / 2000 / XP)
- Using find in a bash shell script (Shell Scripting)
- Shell Script for Gnome 2.6 Print Manager. (Shell Scripting)
Other Threads in the Shell Scripting Forum
- Previous Thread: change user in script
- Next Thread: Full screen prob
| Thread Tools | Search this Thread |





