Moving a complete folder to another linux server
I am running centos on both servers.
I have a folder with 20gb of files and data, that folder has subfolders too. like in /home/website/folder/ I want to move that folder to another server (running centos there too). I have the root login and pw to both servers. I believe there should be a command so I can move the folder over to the other server? so basically here are the paths: server1 /home/website/folder server 2 /home3/website/backup/ I want to move folder over to server 2 in the backup folder. Thanks ! |
Hi,
Welcome to LQ! Look at 'scp'; Quote:
|
My preferred option is rsync.
'man rsync' then get ready for some good reading. Check the examples at the bottom :) |
Thanks for the swift replies.
Can u guyz please give some examples using those paths I mentioned in my first post |
rsync -vaz -rsh=ssh <souce directory> root@<hostname>:<Target directory>
Something akin to that. |
A bit more specifically from server 1,
Code:
rsync -av /home/website/folder/ root@server2:/home3/website/backup |
Quote:
-C |
Hi all,
thanks a lot for the help! I am using the rsync and it is copying the files over now! |
I know this post is solved I would like to add to it for future viewers.
If you would like to move a large number of files the best way (in my opinion) would be to use tar over ssh as tar is faster than rsync when no files exist in the destination. Then after the initial copy then use rsync to grab whatever files have changed as it is faster then tar when there are only a few differences in the file systems. Example: Code:
tar zcf - folder/ | ssh user@server "cd /path/to/dest/; tar zpxvf -" Then use rsync as suggested above to keep the file systems in `sync` |
All times are GMT -5. The time now is 10:33 PM. |