[nSLUG] How to sync two directory trees
D G Teed
donald.teed at gmail.com
Thu May 28 22:07:28 ADT 2009
On Wed, May 27, 2009 at 3:16 PM, Hatem Nassrat <hnassrat at gmail.com> wrote:
> to do this:
> rsync -avz --progress /path/to/HD1/ /path/to/HD2
> Notice the slash after HD1/ it is important, or else you will create a
> directory in HD2 called HD1 which is not what you want.
I'm so glad people are mentioning the trailing slash's importance,
as it is normally what you want to do, and in many other
contexts the trailing slash might be ignored. Here a
trailing slash means something.
Regarding the -z compression option Hatem also mentioned,
you probably don't need it for a local network copy. Especially
if you don't have powerful CPU on one of the machines - it
could actually be slower than uncompressed rsync. This is
even more true after the first time run, where there is less
data to transfer and it doesn't copy entire files if it is possible
to copy only the incremental diff and insert it into the file.
More information about the nSLUG