Copy directories between two linux servers
I am running Redhat Centos 5.2
ServerA (username: root, password: jam) \Work - file1 - file2 - file3 ServerB (username: root, password: butter) What command do I use to copy everything including making a directory from ServerA \Work to ServerB? Thanks. |
Hey there,
check out the man pages for rsync; that command should do the trick for you. Otherwise you can use rsh or ssh (we'll assume that you've got .rhosts set up for rsh or key-based passwordless login setup for ssh) and do something like this from server A to server B on A: tar cpf - Work/file[123]|ssh B "cd /whatever/base/directory/you/want;tar xvpf -" on B (getting from A) in the directory you want the Work directory to end up in: ssh B "cd /whatever/base/directory/Work/is/in;tar cpf - Work/file[123]"|tar xvpf - just substitute rsh for ssh if you want to use that instead. It's much less secure than ssh, but different people have different needs and, if that's not a concern, use whatever works best for you. Best wishes, Mike |
You can also use 'scp' directly to copy files between remote location. Have a look at 'man scp'. It's the copy tool of SSH, so it' quite secure.
Linux Archive |
Quote:
yes rsync will work great for this. Code:
rsync -r [directory] user@dest:[destination directory] |
Try with scp command. The syntax is
# scp -r serverA IP:<obsolute path> <serverB local system path> |
All times are GMT -5. The time now is 07:49 PM. |