Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: UNIX Q: Tricky SCP between 3 boxes without creating transient fil

Re: UNIX Q: Tricky SCP between 3 boxes without creating transient fil

From: <Brian_P_MacLean_at_efunds.com>
Date: Wed, 07 Aug 2002 08:30:39 -0800
Message-ID: <F001.004ADA81.20020807083039@fatcity.com>

I haven't had the joy of working with ssh and scp in a bit so the syntax below might need adjusting a bit.

If I get this right you are running a command on BoxA, need to plow/passthrough BoxB, and get a file from BoxC...right? As long as you have generated your keys via ssh-keygen and no longer require passwords to ssh/scp from box-to-box, this command should work from BoxA. I work using the ksh shell, so I don't know if this will work if sh, bash, csh, etc. shells are your accounts default shell.

(ssh BoxB "ssh BoxC 'compress </InDir/MyFileIWant'") | uncompress
>/OutDir/MyFileHasArived

 If that doesn't work try this one.

(ssh BoxB "ssh BoxC \"compress </InDir/MyFileIWant\"") | uncompress
>/OutDir/MyFileHasArrived

If you don't want to compress/uncompress (which is faster by my testing) you can just change the command to use "cat".

(ssh BoxB "ssh BoxC \"cat /InDir/MyFileIWant\"") | cat
>/OutDir/MyFileHasArrived

The key here is that ssh will allow you to pass a command to run on the machine you ssh to. Kind of like doing "ksh -c my_command". There is no reason that the command can't be another ssh and command paring. I did some jobs years ago in my dot-bomb daze that went 2 levels through the fire wall, but there is no reason you couldn't go 3, 4, even 5 levels deep. It's just a matter of syntax.

GL

                                                                                                                                         
                      Ross Collado                                                                                                       
                      <Ross.Collado_at_tec        To:       Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>                     
                      hpac.com>                cc:                                                                                       
                      Sent by:                 Subject:  UNIX Q: Tricky SCP between 3 boxes without creating transient fil               
                      root_at_fatcity.com                                                                                                   
                                                                                                                                         
                                                                                                                                         
                      08/07/02 12:48 AM                                                                                                  
                      Please respond to                                                                                                  
                      ORACLE-L                                                                                                           
                                                                                                                                         
                                                                                                                                         




Hello gurus,

Env:

BoxA - outside the firewall.
BoxB - inside the firewall
BoxC - inside the firewall

All boxes are Solaris 8.

BoxA has the file expdat.dmp size 1.9Gb. BoxA has no access to any of the boxes inside the FW.
BoxB is the only box that can reach out to BoxA through the FW. BoxB has an exception rule in the FW.
I wanted to copy (using scp) expdat.dmp from BoxA to BoxC. I could have simply scp'd from BoxB then scp it again to BoxC, however, because of space restrictions in BoxB, this is not an option. I was thinking of using 'pipe file' using mkfifo in BoxB to scp (pull) the file from BoxA then immediately scp (push) the same to BoxC. BoxB is kind of
like a middleman then.
I attempted using my script below but I got an error and core dump.

#!/bin/ksh
#This SCP script executed from BoxB

rm /home/oracle/tmp/fifo
mkfifo /home/oracle/tmp/fifo
scp -q /home/oracle/tmp/fifo   BoxC:/home/oracle &
scp -q BoxA:/oracle1/export/expdat.dmp /home/oracle/tmp/fifo #
#End

The error is:
/home/oracle/tmp/fifo: not a regular file Segmentation Fault(coredump)

Are pipe files useable in scp's? How? I know I've used them before in EXPorts that pipes to a gzip but I can't seem to get it to work for scp. I'm only trying to avoid creating a transient copy of expdat.dmp in BoxB. Otherwise, I might have to clear out some space in BoxB (which I'm desperately trying to avoid).

Any suggestions?

Rgds,

Ross

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Ross Collado
  INET: Ross.Collado_at_techpac.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).





-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: Brian_P_MacLean_at_eFunds.Com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Aug 07 2002 - 11:30:39 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US