Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to copy directory foo from server A to server B.

what is the way to do it using rsync?

  • foo is a large directory so I need the copy will be fastest as possible.


share|improve this question

closed as not constructive by womble, Tim Brigham, Scott Pack, rnxrx, Jeff Ferland Aug 23 '12 at 6:36

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

I want the copy to be one way, only to transfer files from A to B and not the other way around – Ran Jul 25 '12 at 9:28
up vote 0 down vote accepted

Failing that, compress foo and copy the resulting archive over SSH using scp to your new server, then extract it.

tar -cvzf foo.tar /path/to/foo
scp foo.tar you@newserver:/path/to/wherever (I'd put it in /tmp)
tar -xvzf foo.tar -C /path/to/foo
share|improve this answer
rsync -a /foo/ destserver:/foo/
share|improve this answer
will this effect the data on A if part of the data exist on B? – Ran Jul 25 '12 at 9:35
what about compression? can I use the IP of B? – Ran Jul 25 '12 at 9:36
Questions go in questions, not comments. – womble Jul 25 '12 at 9:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.