What is the best way to duplicate files on server via ssh?
In my case: I'm talking about duplicating magento shop. (15000 files ~ 50MB)
cp -a source destination
Is taking hours... (in my case server is 2.4 Xeon, 2GB RAM)
migrated from stackoverflow.com Jan 17 '12 at 9:02
This question came from our site for professional and enthusiast programmers.
Note that if you're on a slow link, or the server is under heavy load, the tool used for copying won't be the bottleneck, and any way of copying will be slow anyway.
This should give you the basic usage for copying between your local computer and the remote server: http://oreilly.com/pub/h/38
To copy from local computer to a remote server (you need to replace the paths, user name and host address, of course):
To copy in the other direction, switch the paths (first is from, second is to):
But rsync is useful even for copying things around on the same server:
For one-shot deals, scp is handy. If it's a lot of files, then rsync is a good idea. If a connection is dropped, rsync can pick up where it left off.
I knew that rsync had compression (