The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
probloem in scp command 99% content only transfers GovindGembali UNIX for Dummies Questions & Answers 1 06-20-2008 03:43 AM
History of old FTP transfers Nakul Mukerjee UNIX for Dummies Questions & Answers 4 05-02-2007 03:39 AM
gateway big123456 Linux 3 11-21-2005 10:12 PM
Automate FTP / Scripting FTP Transfers Perderabo Answers to Frequently Asked Questions 0 05-20-2004 05:50 PM
text files, ASCII files, binary files and ftp transfers Perderabo Answers to Frequently Asked Questions 0 04-08-2004 01:25 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-28-2008
Registered User
 

Join Date: May 2008
Location: Sydney
Posts: 16
ssh - transfers with gateway hopping

Hi,

I am having trouble transferring files from a source UNIX machine to a
destination UNIX machine by hopping via 2 gateway machines.
The user used for the transfer has been setup/authorized so no password is
required to login. Summerized:
source to gateway1 to gateway2 to destination

This is the command executed from the source computer:
tar cf - .|ssh gateway1 ssh gateway2 "ssh dest 'cd /tmp;tar xf -'"
I get following error:
tar: blocksize = 0

If I change the command to:
tar cf - .|ssh gateway1 ssh gateway2 "ssh dest tar xf -"

Then the files are transferred albeit into the wrong directory but the
command on the source computer never completes.

How can I fix:
1) get the cd /tmp to work
2) get the command to come back when the transfer is complete

Thanks for any help
Reply With Quote
Forum Sponsor
  #2  
Old 09-29-2008
ynilesh's Avatar
Registered User
 

Join Date: Oct 2007
Location: Bangalore, India.
Posts: 174
Can you please explain your scenario?
Are you able to connect to destination system?

I don't think these gateway's should matter.

- nilesh
Reply With Quote
  #3  
Old 09-29-2008
wempy's Avatar
Registered User
 

Join Date: Jun 2006
Location: Harpenden, UK
Posts: 177
I think you need to run the commands at the destination in a sub-shell at the destination (replace the single quotes with parenthesis)
Code:
tar cf - .|ssh gateway1 ssh gateway2 "ssh dest (cd /tmp;tar xf -)"
may do what you require, but I don't have four machines to test this with, have tried it between two and it works.

And the reason the originating tar doesn't complete is probably because it is waiting for input from the command line (tar cf -) for the files you wish to archive. to close it you need a CTRL-D in the input stream, or give it a list, or a toplevel directory (tar cf - /top/level/directory/)

Last edited by wempy; 09-29-2008 at 04:18 AM. Reason: clarification and correction
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0