I have a need to sync two directories on OSX. I find this post recommending using unison.
I tried unison, it seems it can sync two directories very well. But it doesn't do synchronization automatically( always keep two directories synced when there's any change ).
So I guess to accomplish my purpose, unison should be used with a trigger which will watch changes and notify unison to do its work.
But how to do that? Any recommendation and tutorial?
Unison has this capability built in. Just add the line repeat = watch
to your Unison profile.
Install Unison:
brew install unison
Install unox:
git clone [email protected]:hnsl/unox.git
cd unox
ln -s $PWD/unox.py /usr/local/bin/unison-fsmonitor
Do the initial sync:
unison -auto -batch dirA dirB
Run the continuous bidirectional sync:
unison -auto -batch -repeat watch -times dirA dirB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With