[plug] Merging two directories

Jason Nicholls jason at mindsocket.com.au
Mon Oct 12 14:47:23 WST 2009


> I need to merge two directories, which are fairly large ~4GB each.
> 
> A copy of the original dir (dir2) was taken two weeks from the
> original (dir1) and altered over that time.  Need to merge dir2 back
> into dir1.  I can find differences with diff or find.
> Some files are newer and *smaller* which are suspect and need to be
> manually analysed, thus either flagged or left alone by the tool.
> 
> Anyone know a good tool I could use??

rsync -vaur <source> <dest>

    -v = verbose
    -a = archive mode (preserves all your bits)
    -u = update only
    -r = recursive (not needed if it's just a flat directory)

Rsync will only do updates to files that have changed. Source should be
the directory with the latest copy, dest is the older copy (that you
want to update).

You can also use -n to perform a dry-run, i.e. inspect what rsync would
have done...


Jason Nicholls
--------------------------------------------------------------------
Jason Nicholls                     email: <jason at mindsocket.com.au>
http://jason.mindsocket.com.au/   mobile: +61 430 314 857
--------------------------------------------------------------------
   pgp/gpg id: 0xC3844959  
  fingerprint: 7F7A 5846 4E94 459C 104D  A979 7079 24CF C384 4959




More information about the plug mailing list