Transport to another server within a script.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Transport to another server within a script.
# 1  
Old 09-29-2008
Transport to another server within a script.

I'm not sure how to phrase this...

We currently have a server that we have to load a special kind of file onto, to do this we have a script that someone on my team wrote years ago called emm <file>. We recently added another server to our system, so every file that's added on one has to be added to the other. I want to write a script that will scp the file to the other server, run the original script locally, and then ssh to the other system and run it there. I tried just doing

Code:
ssh $owner@10.252.1.1 '/export/home/dncs/bin/emm $1'

But there's something in the actual script (emm) that is causing it not to work, sadly I don't have the the actual error message as I'm not at work right now, but it had something to do with the script calling on who am i, as well as some other problems.

I'm really not advanced enough to try to rewrite the original script, so I'm curious. Is there some other syntax for ssh that would actually take the user to the other server and execute the command as if it were being done locally?
# 2  
Old 09-29-2008
Re : Transport to another server within a script.

According your description given below
you have this
server1 - which has the script 'emm' and filename 'file'
server2 - which has the script 'emm'
and you want to do this
1) scp the 'file' to server2 from server1
2) run the script 'emm file' on server2 from server1

If that is your requirement, you can achieve this by
1) scp the file to server2
Quote:
scp $owner@10.252.1.1 file
2) run the script remotely
Quote:
ssh $owner@10.252.1.1 '/export/home/dncs/bin/emm file'
but both these steps would require to login to server2 from server1 which would require the login credentials,
If that bothers you, you can implement the ssh authentication without passwords which is a one time event and a simple 2 step procedure
1) run this command on server1
Quote:
ssh-keygen -t dsa
2) run this command on server2
Quote:
scp ~/.ssh/id_dsa.pub <user>@<server2>:~user/.ssh/authorized_keys
Noe you'll able to connect to server2 from server1 without any password
and run any command on server2 from server1
# 3  
Old 09-30-2008
Hard to say without the error output. Maybe try setting $owner to ${owner} but this does must not be the reason why you get errors (it's just for safety of substitution through the shell). And if you can post your and the "emm"-script too, that would be helpful too. Best use the [ code ] and [ /code ] tags in this forum to present the code eye friendly.
Without error output it's just guessing around.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Transfer file from server B to server C and running the script on server A

I have 3 servers A, B, C and server B is having some files in /u01/soa/ directory, these files i want to copy to server C, and i want to run the script from server A. Script(Server A) --> Files at Server B (Source server) --> Copy the files to Server C(Target Server). We dont have RSA key... (4 Replies)
Discussion started by: kiran_j
4 Replies

2. Solaris

Sense key unit attention & iostat hardware and transport errors on SAN disks

Hello, I'm trying to get to the bottom of SAN disk errors we've been seeing. Server is Sun Fire X4270 M2 running Solaris 10 8/11 u10 X86 since April 2012. SAN HBAs are SG-PCIE2FC-QF8-Z-Sun-branded Qlogic. SAN storage system is Hitachi VSP. We have 32 LUNs in use and another 8 LUNs not brought... (4 Replies)
Discussion started by: TKD
4 Replies

3. Solaris

getpeername: Transport endpoint is not connected

Hi Folks, I am getting the following error in /var/adm/messages. Can any one help me out on this? ZXXXXXA:/# tail /var/adm/messages Oct 26 00:13:04 ZXXXXXA ftpd: setsockopt SO_KEEPALIVE Invalid argument Oct 26 00:13:04 ZXXXXXA ftpd: setsockopt (SO_OOBINLINE): Invalid argument Oct 26... (3 Replies)
Discussion started by: vivek.goel.piet
3 Replies

4. UNIX for Dummies Questions & Answers

transport errors in iostat

Hi Unix experts, I have a question regarding a disk failure seen in "iostat -Enm" output: # iostat -Enm c1t0d0 Soft Errors: 0 Hard Errors: 7 Transport Errors: 9 Vendor: FUJITSU Product: MAU3073NCSUN72G Revision: 0802 Serial No: 0514F005M0 Size: 73.40GB <73400057856 bytes> Media... (5 Replies)
Discussion started by: dyavuzy1
5 Replies

5. Programming

Problem transport endpoint is not connected

i've made a simple program that change a string from lowercase to uppercase and from uppercase to lowercase. Server works until start client, after client run server give this error: "recv server fallita: Transport endpoint is not connected" why? i think that stream closed too soon or not? below... (1 Reply)
Discussion started by: tafazzi87
1 Replies

6. Solaris

What is the difference between softerrors,harderrors,transport errors?

what is the difference between softerrors,harderrors,transport errors? (3 Replies)
Discussion started by: tv.praveenkumar
3 Replies

7. Solaris

SC3.2 issue - cluster transport configuration not right - resulting fail

I am trying to set up a two host cluster. trouble is with the cluster transport configuration. i'm using e1000g2 and g3 for the cluster transport. global0 and global1 are my two nodes, and I am running the scinstall from global1. i think i should be expecting, is this: The following... (19 Replies)
Discussion started by: frustin
19 Replies

8. UNIX for Advanced & Expert Users

Transport Error

Dear Friends, I am using Solaris 10 on Sun Sparc T5120 with 4 HDD(Raid).I am getting transport error in one of my mirrored HDD c1t2d0. Below is a screen shot. I have replaced the HDD with new one but still the same. Any one can help???? c1t2d0 Soft Errors: 0 Hard Errors: 0... (1 Reply)
Discussion started by: solaris5.10
1 Replies

9. Solaris

PLOGI failed state=Packet Transport error

Someone who can help me. the following error occur, what does it mean, and any possible solution you can give.thanks syslog: fp: NOTICE: fp(2): PLOGI to d5900 failed state=Packet Transport error , reason=No Connection (Database) $cat /var/adm/messages Nov 3 05:16:21 vfaus279 fp: ... (7 Replies)
Discussion started by: o_m_g
7 Replies
Login or Register to Ask a Question