The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to include RETURN KEY with Background process "&" in Shell Script racbern Shell Programming and Scripting 1 03-11-2008 03:30 AM
#!/bin/sh script fails at StringA | tr "[x]" "[y]" by_tg UNIX for Dummies Questions & Answers 3 02-22-2008 08:17 AM
passing a list of dynamic names to a "PS" command in shell script? sachin.tendulka Shell Programming and Scripting 3 11-21-2007 12:18 AM
Q: Recording shell script screen output using "script" command ? lalfonso.gomez Shell Programming and Scripting 4 01-18-2007 05:31 PM
No utpmx entry: you must exec "login" from lowest level "shell" peterpan UNIX for Dummies Questions & Answers 0 01-18-2006 12:15 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-20-2006
Registered User
 

Join Date: Dec 2006
Posts: 2
Shell Script fails with "can't connect to client"

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.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-20-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,323
Hi Srinivas,
The 'can't connect to client' error is not due to the script. It is due to connectivity issues between the netbackup master and the client or the media server and the client. If you are using a dedicated private lan for backup connectivity, make sure that the client that you are trying to connect to is reachable from the server where you are running the bpmedia command.
Reply With Quote
  #3 (permalink)  
Old 12-20-2006
Registered User
 

Join Date: Dec 2006
Posts: 2
Hi blowtorch,

I appreciate your earliest response. I am running this script on the master server and this script doesn't depend on any clients because no media database is stored on clients. This script picks all frozen media from media database located on media servers and unfreezes them. We are using a dedicated backup lan and the connectivity between the master and media servers is perfectly working fine.

I am running this command as an ordinary user and hence I have used pbrun in my script. I have also tried running this script as a super user with my Unix admin help and it worked perfectly. As per my Unix admin this could be due to permissions. He suggested me using "while" loop instead of "for" loop in the script and this may resolve the issue(not sure) because "for" loop issues the commands parallely but "while" issues commands one at a time.

Appreciate your suggestions on this to run my script successfully.

Thanks in Advance,
Srinivas Rao S.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0