I'd like to automatically run a one way sync between two local directories using rsync
. Meaning when a change is detected in a file of /dir1
or its subdirs, the following command should run:
rsync -rtuv /dir1 /dir2
How can I go about achieving this with fswatch
?
Is it possible to supply arguments for rsync
to only copy the actual files that were changed, as given by the fswatch
events?
rsync
is already pretty optimal about only doing the minimum necessary updates - why not just go withfswatch . | while read f; do echo rsync; done
? bryanpendleton.blogspot.co.uk/2010/05/rsync-algorithm.html