Google Answers Logo
View Question
 
Q: How do I copy a large number of files between 2 remote Linux servers ( Answered,   0 Comments )
Question  
Subject: How do I copy a large number of files between 2 remote Linux servers
Category: Computers > Internet
Asked by: diamondgeezer-ga
List Price: $2.00
Posted: 16 May 2003 12:22 PDT
Expires: 15 Jun 2003 12:22 PDT
Question ID: 204739
How do I copy a large number of files between 2 remote Linux servers,
simply, safely and as quickly as possible without changing their
attributes?

There is no room on the original server to TAR the files

Thanks
Answer  
Subject: Re: How do I copy a large number of files between 2 remote Linux servers
Answered By: vorfeed-ga on 16 May 2003 13:12 PDT
 
Dear diamondgeezer, 

One easy way to do this is to use Secure Copy, or scp. It's a part of
the OpenSSH package.

"scp copies files between hosts on a network.  It uses ssh(1) for data
transfer, and uses the same authentication and provides the same
security as ssh(1).  Unlike rcp(1), scp will ask for passwords or
passphrases if they are needed for authentication.

Any file name may contain a host and user specification to indicate
that the file is to be copied to/from that host.  Copies between two
remote hosts are permitted."
"scp manual page" by Timo Rinne and Tatu Ylonen, September 25, 1999

If you use the -p flag on your scp command line, scp will preserve
modification and access times, as well as file permissions. Another
flag that you will probably want to use is -r, which copies entire
directories recursively. Optionally, the -C flag causes scp to use
compression when copying the files. This might result in a speed
increase, if you are planning to copy many large files.

Here's a basic example of how to use scp to copy files from one remote
machine to another:

scp -p -r username@host1:/home/username
username@host2:/home/username_backup

This would copy everything in the /home/username directory on host1
into the /home/username_backup directory on host2, preserving
attributes.

I'd suggest experimenting by copying a few useless files back and
forth, just to make sure you get the outcome you're looking for,
before using scp to copy your important files.

Additional Links:

Your Linux distribution may already have scp installed, but if your
computer is lacking it, you can download scp for free at one of the
mirror sites listed here:
http://www.openssh.org/portable.html

Once scp is installed, you can find out more about it by typing "man
scp" at your shell prompt. This will display the scp manual page that
I quoted from earlier.

Search Strategy:

I searched Google using the terms: linux scp
://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&q=linux+scp&btnG=Google+Search

I hope this helps, and thanks for submitting your question. Please
feel free to request a question clarification, if this answer does not
meet your needs. Thanks again!
-vorfeed_ga

Clarification of Answer by vorfeed-ga on 16 May 2003 13:15 PDT
Just a note: the example command line I wrote got broken up into two
lines when I posted your answer. I'm sorry about that. The command
should be entered on just one line, like so:

scp -p -r username@host1:/path username@host2:/path_backup

Sorry for the bad formatting. Thanks again!
-vorfeed_ga
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy