|
/Admin/commandLine:
Copying Directories Between Machines
When copying directories between two servers, there are two main candidates to choose from:
scp -rp apache2/ root@server.com:/etc/
rsync -avz -e ssh apache2 root@server.com:/etc/
| rsync | scp |
| fast | slow |
| does well over poor network | does poorly |
| requires rsync and ssh servers installed on both ends | only requires ssh server |
| preserves sym links | does not |
| can continue an interrupted transfer | must start from scratch |
| be careful to use ssh tunnel for secure tranfer | all transfers encrypted |
With rsync also be careful about the source specification. "apache2" will create an apache2 directory in the destination /etc/. But "apache2/" will copy the files contained within apache2 into the destination /etc/. You want the former.
posted at: 12:50 | path: /Admin/commandLine | permanent link to this entry