[nSLUG] How to sync two directory trees

Hatem Nassrat hnassrat at gmail.com
Wed May 27 15:16:44 ADT 2009


On Wed, May 27, 2009 at 2:34 PM, Mike Spencer <mspencer at tallships.ca> wrote:
>      Any new files on HD2 (that don't exist on HD1) can stay, but
>
>      Any files on HD2 with same path/name as on HD1 must be same as
>      on HD1, and
>
>      Any files on HD1 that are absent from HD2 must be copied over.

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.

Of course you can still use unison, it has a nice GUI but a hard
command line (or atleast thats how I find it), and setup the rules you
mentioned above on it. Since rsync works for your usecase, I would
just use rsync.

-- 
Hatem Nassrat



More information about the nSLUG mailing list