cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout command in for loop for UNIX

GopiKrishna208
Level 3

We have master & media server running on solaris platform and I have 1000+ client IP's and i want to check bptestbpcd output for all clients.And i am executing below for loop to check in a single go but if incase netbackup is not installed on any one of client PC the output is taking too long to print.Can any one suggest me the faster way to check.

for i in `cat /tmp/VLANIP.txt`; do echo $i; sudo bptestbpcd -verbose -client $i; done;

 

GK
1 ACCEPTED SOLUTION

Accepted Solutions

Marianne
Level 6
Partner    VIP    Accredited Certified

The Client Connect timeout for the server where you are running the command will be used.

You can possibly reduce this timeout to 30 or 60 sec before you start. 

Oh! Wait!

It seems that bptestbpcd has a -connect_timeout option:

https://www.veritas.com/support/en_US/doc/15263389-127350397-0/v14667804-127350397

bptestbpcd [-host hostname] [-client client_name] [-M server] [-connect_options 0|1|2 0|1|2 0|1|2|3] [-connect_timeout seconds

View solution in original post

4 REPLIES 4

Genericus
Moderator
Moderator
   VIP   

You could force the sub command to the background, so you did not have to wait.

for i in `cat /tmp/VLANIP.txt`

do echo $i

sudo bptestbpcd -verbose -client $i &

done

Then once it completes, search for the hung processes, lol

NetBackup 9.1.0.1 on Solaris 11, writing to Data Domain 9800 7.7.4.0
duplicating via SLP to LTO5 & LTO8 in SL8500 via ACSLS

Marianne
Level 6
Partner    VIP    Accredited Certified

The Client Connect timeout for the server where you are running the command will be used.

You can possibly reduce this timeout to 30 or 60 sec before you start. 

Oh! Wait!

It seems that bptestbpcd has a -connect_timeout option:

https://www.veritas.com/support/en_US/doc/15263389-127350397-0/v14667804-127350397

bptestbpcd [-host hostname] [-client client_name] [-M server] [-connect_options 0|1|2 0|1|2 0|1|2|3] [-connect_timeout seconds

Tousif
Level 6

Hello,

I think bptestnetconn can also help to check the communication between Master and clients.

C:\Program Files\Veritas\NetBackup\bin>bptestnetconn.exe

 

Regrads,

 

Nicolai
Moderator
Moderator
Partner    VIP   

I have used bptestbpcd with the connect_timeout as Marianne suggest for exactly that reason, the connect_timeout parameter works very well.

Else look into using the command called "timeout" if you are on Linux. e.g  "timeout 2 top" Will kill top command after to seconds.