1. ssh to system A ,from there ssh to system B & from there ssh to
system C.
2. At system C need to connect to a DB and execute few queries and
create an output file
3. The outfile should be SCpied to Sytem A
Using command ssh -L -T, I am able to end up at System C with perl
command system. Am stuck there as in the output the cursor remains at
system C but I need the script to perform step 2 and 3 as mentioned
above.
Thanks in advance,
pRADEEP
You should be using Net::SSH.
I'd use Expect.
Note that it's not for the faint of heart ;-)
Josef
--
These are my personal views and not those of Fujitsu Technology Solutions!
Josef M�llers (Pinguinpfleger bei FTS)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html
The script must:
1. ssh to system A ,from there ssh to system B & from there ssh to system C.
2. At system C need to connect to a DB and execute few queries and create an output file
3. The outfile should be SCpied to Sytem A
Using command ssh -L -T, I am able to end up at System C with perl command system.
Am stuck there as in the output the cursor remains at system C but I need the script to perform step 2 and 3 as mentioned above.
> The script must:
>
> 1. ssh to system A ,from there ssh to system B & from there ssh to
> system C.
> 2. At system C need to connect to a DB and execute few queries and
> create an output file
> 3. The outfile should be SCpied to Sytem A
>
If the script is on host C:
ssh A ssh b ssh C <script> >outfile
If the script is on host A:
cat <script> | ssh A ssh b ssh C sh - >outfile
So first make a script on C that works, then try to execute it via ssh
HTH,
M4