SSH Script is sticking, & sign not doing what I would expect


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SSH Script is sticking, & sign not doing what I would expect
# 1  
Old 10-24-2011
SSH Script is sticking, & sign not doing what I would expect

I am having an issue where I am do an SSH to about 30 servers one at a time however my script is getting hung up sometimes on the SSH.
I thought the & at the end as seen below would fire it and move on but that does not seem to be working.

Code:
#!/bin/s
for remsys in trumpetsnail angel delphin kraken bluemarron penguinshrimp moccasin roughgreen bluegarter eastindigo penribbon ringneck banded bl
ackracer applesnail skimmerclam seaclam
        do
        /lcl/tools/bin/sshPing.pl $remsys
VAR=$`/usr/bin/ssh $remsys "/lcl/apps/Tivoli/netcool/omnibus/bin/syslog_mon.sh" 2>&1 &`
Results=${VAR}
echo $Results
done

Any ideas?
# 2  
Old 10-24-2011
Looks like it is working in the same way as rdist ( at least the version I used for Y2K stuff...), it will still wait till the end before to pass to next ARG ( server )...
Can you stop the execution at that point? (I could not with rdist...)
# 3  
Old 10-24-2011
So far it seems like nothing I try works to break out of it.
The odd thing is that it is very random. It will stop at random points in the server list. So one time the SSH might stick on one server and then another time it may stick on another. Is there any way to maybe stick this in some sort of time logic? So another words each time it does a SSH to a server it counts down to say... from 30 to 1. If it does not get results by reaching 1 then it moves on.

The & symbol just does not seem to be working in this case.
Any ideas?

Thanks
# 4  
Old 10-24-2011
double post: Closed
continue here:
https://www.unix.com/emergency-unix-l...m-working.html
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SFTP or scp with password in a batch script without using SSH keys and expect script

Dear All, I have a requirement where I have to SFTP or SCP a file in a batch script. Unfortunately, the destination server setup is such that it doesn't allow for shell command line login. So, I am not able to set up SSH keys. My source server is having issues with Expect. So, unable to use... (5 Replies)
Discussion started by: ss112233
5 Replies

2. Emergency UNIX and Linux Support

SSH Is hanging and the & sign does not seem to be working

I am having an issue where I am do an SSH to about 30 servers one at a time however my script is getting hung up sometimes on the SSH. I thought the & at the end as seen below would fire it and move on but that does not seem to be working. #!/bin/sh for remsys in trumpetsnail angel... (15 Replies)
Discussion started by: LRoberts
15 Replies

3. Shell Programming and Scripting

expect ssh script cannot finish and exit

All i am new to linux, and try to have a simple expect script to ssh then telnet to the network equipment, and exit itself. but dont know why i hang at the last $ #!/usr/bin/expect set timeout 10 set arg set arg1 spawn ssh -l UserA 1.1.1.1 expect "assword:"; send "PasSwOrD\r";... (1 Reply)
Discussion started by: samoptimus
1 Replies

4. Shell Programming and Scripting

Passing Password to SSH without using expect in a Script

How can I pass password in SSH command without using expect in a shell program. I don't have expect installed on my Solaris server. #!/bin/bash ssh user@hotname (how to supply pass in script?:wall:) Experts please help its very urgent. Shrawan Kumar Sahu (4 Replies)
Discussion started by: ss135r
4 Replies

5. Shell Programming and Scripting

Script using SSH with expect command

Hi all, I want to connect to some host with "ssh". I have googled and got some commands of "expect" and "spawn". I was not aware of these commands and tried below script. $ cat auto.sh set host xx.xx.xx.xx set password abcd@1234 set user root spawn ssh $user@$host expect "*?assword:*"... (4 Replies)
Discussion started by: divya bandipotu
4 Replies

6. Shell Programming and Scripting

Replace & sign to &amp word

Hi, I have text file abc.txt. In this file, I have the following data. Input: Mr Smith &amp Mrs Smith Mr Smith &apos Mrs Smith Mr Smith & Mrs Smith Mr Smith& Mrs Smith Mr Smith &Mrs Smith Output: Mr Smith &amp Mrs Smith Mr Smith &apos Mrs Smith Mr Smith &amp Mrs Smith Mr Smith&amp... (4 Replies)
Discussion started by: naveed
4 Replies

7. Shell Programming and Scripting

expect ssh script issue with if and foreach

Hi, I am trying to create an ssh script to login to cisco routers and activate/deactivate bgp neighbors if they match certain conditions. I dont think my "if" and "foreach" are working correctly. Any help is appreciated. Below is my script: ... (0 Replies)
Discussion started by: blahblahsomeone
0 Replies

8. Shell Programming and Scripting

Expect Script to Automate SSH

How would I write an expect script to automate ssh and what file extention do expect files use? (11 Replies)
Discussion started by: Prodiga1
11 Replies

9. Shell Programming and Scripting

SSH Expect Script

Ok, i don't know if anyone else here have had to deal with something like this before, but here's my situation. I have about 1000+ servers I need to log into to do something. What i need to do is to log into each server, go to a certain directory on each of the servers, copy the files that... (3 Replies)
Discussion started by: SkySmart
3 Replies

10. Shell Programming and Scripting

Expect script to ssh into MMI

Guys, I know this is tricky.. I'm trying to write a script to pull info from a MMI device. Following script logins into the server and then changes to super user. Opens MMI session and then exits out. I need to run the command under the MMI session "dsp_alarm_span all" Is there any other way to... (2 Replies)
Discussion started by: miltonrods
2 Replies
Login or Register to Ask a Question