MacOS – Synchronise folders on different Macs using rsync

macosNetworkrsync

I am trying to synchronise two different folders using rsync. I have copied all the data worth 4Tb from a network share to an external hdd using rsync -v -r /source /destination. Now I need to run regular backup to sync both the locations. Can anyone suggest rsync command which I can use to synchronise both the folders.

Best Answer

The best way is to continue to use rsync so as to maintain /destination synchronized with /source.

1st run:

rsync -avE /source /destination

next runs:

rsync -avE /source /destination

The -a option = --archive == -rlptgoD.

The -E option means copy extended attributes and ACL, and is mandatory on HFS+ filesystems.

Warning: the standard version of rsync on OS X, version 2.6.9 (see rsync --version) still have problems with extended attributes. These problems will be shown thanks to the -v option.

A verification of the output of rsync is mandatory.

This version 2.6.9 is too old and causing too many problems.


I advise any user willing to maintain in sync directories between different Macs (or between a Mac and another Unix machine) to install rsync version 3.1.2.

Here is the method I use:

  1. install MacPorts: MacPorts home page

    • go to the Quickstart section, install Xcode
    • choose the right version to install (Mavericks, Yosemite or El Capitan)
  2. Upgrade your PATH so as to find the port command in it for example, I installed it in /local/bin and modified my PATH like this:

    PATH=/local/bin:${PATH}
    export PATH
    
  3. Install rsync 3.1.2:

    port install rsync
    

With this version of rsync, the right options to use will be:

rsync -avAX /source /destination

and if you read me thus far, you are pretty good enough now to read

man rsync

to get the light from the source.