Shell Script fails with "can't connect to client"


 
Thread Tools Search this Thread
Operating Systems HP-UX Shell Script fails with "can't connect to client"
# 1  
Old 12-20-2006
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.
# 2  
Old 12-20-2006
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.
# 3  
Old 12-20-2006
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

Bash script fails with "function: not found" error

Hello everyone, I am having problems figuring this out. This script below is supposed to create a list of file names with their "md5sum", in a file "lib-list.txt" When I run it "sh component-list.sh " I get this:component-list.sh: 4: component-list.sh: function: not found component-list.sh:... (4 Replies)
Discussion started by: joemb
4 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. UNIX for Dummies Questions & Answers

Expect "interact" fails when called from another script

So, I have an expect script (let's call it expect.exp) that takes 3 arguments. It logs into a remote server, runs a set of commands, then hands control over to the user by the "interact" command. If I call this script from the command line, it works properly. Now I'd like to apply this script... (2 Replies)
Discussion started by: treesloth
2 Replies

5. AIX

"too big" and "not enough memory" errors in shell script

Hi, This is odd, however here goes. There are several shell scripts that run in our production environment AIX 595 LPAR m/c, which has sufficient memory 14GB (physical memory) and horsepower 5CPUs. However from time to time we get the following errors in these shell scripts. The time when these... (11 Replies)
Discussion started by: jerardfjay
11 Replies

6. Windows & DOS: Issues & Discussions

Samba (SMB) client fails: "Called name not present"

Hi, I issue smbclient on a Linux REd hat server : smbclient -L ***.16.0.42 -U domaine/Administrator Password: Domain= OS= Server= Domain= OS= Server= Sharename Type Comment --------- ---- ------- IPC$ IPC IPC distant ... (0 Replies)
Discussion started by: big123456
0 Replies

7. Linux

Help req for...shell script to catch "db2 connect" errors ...

Hello friends, Assume that, I am trying to execute a "db2 connect" command from Linux shell prompt via a shell script called "sample" sample db2 connect to bas39 $sample If the database is not present its should display a custom error message by catching the error message given by db2.... (1 Reply)
Discussion started by: frozensmilz
1 Replies

8. UNIX for Dummies Questions & Answers

How do I connect a hpux10.x os machine to "the internet" via a WinXP client?

I am wondering how can I cross this technical border of my ignorance for quite sometime, 6 months to be more exact, and just don't get it quite. I did read some newbies' literatures on UNIX OS but could not find the key to unlock the HP workstations (OS dated 1997 maybe because the man page... (0 Replies)
Discussion started by: liumx2000
0 Replies

9. UNIX for Dummies Questions & Answers

#!/bin/sh script fails at StringA | tr "[x]" "[y]"

I need to take a string (stringA) check it for spaces and replace any spaces found with an equal (=) sign. This is not working. There are spaces between each component: $StringA | tr "" "" The error returned is: test: Specify a parameter with this command Can you help? (3 Replies)
Discussion started by: by_tg
3 Replies

10. UNIX for Dummies Questions & Answers

No utpmx entry: you must exec "login" from lowest level "shell"

Hi I have installed solaris 10 on an intel machine. Logged in as root. In CDE, i open terminal session, type login alex (normal user account) and password and i get this message No utpmx entry: you must exec "login" from lowest level "shell" :confused: What i want is: open various... (0 Replies)
Discussion started by: peterpan
0 Replies
Login or Register to Ask a Question