How do I keep two external drives synced in two ways?

1

I'm running MacOS High Sierra and just got a new 3TB external USB hard drive. On this drive, I have set up one 500GB encrypted MacOS Extended volume. I also have another 500GB portable external hard drive, which contains one 500GB (also encrypted, also MacOS Extended) volume.

I would like for the two volumes to be in sync with each other. There's a catch though: it has to be a two-way sync. So if I update or delete files on one drive, the changes have to be copied to the other.

There's a second catch: the drives will be connected at different moments. I want the synchronization to happen whenever both drives are connected.

Does anyone know of a tool that will allow me to do this? Unison seems a pretty close match, but I'm not sure how to set it up so that it checks whether both drives are present etc.

astrarum

Posted 2018-09-15T16:39:51.947

Reputation: 11

Unison can't do this on its own, but you could write a shell script that checks if the drives are mounted, and only runs Unison if they are. The details of the script will have to change depending on whether, once both drives are mounted, you want to check for changes continually between the drives (use Unison's repeat = watch option), or only sync every few seconds or minutes or something.

– Mike Pierce – 2018-09-15T17:26:06.977

You might look at rsync as you could trigger it running wirh both drives are in the system at the same time. – Hogstrom – 2018-09-16T00:33:01.953

What happens if you updated file X separately on both drives and then try to sync? What do you want to happen? – user151019 – 2018-09-19T22:29:31.523

No answers