I need to replicate a folder over a very slow link to several destinations.
Currently I create a text file with find.
find "$sourcedir" -exec ls -la {} \; > "$statefile"
I then compare it to a previous file created the same way to determine whether the script should exit or perform a few rsyncs. In the end the new statefile becomes the old statefile for next time the script runs.
if ! diff "$statefile" "$statefile".old
Is there a better way minimising resource usage on source? (Compatible with bash on Debian.)
Should I just run the first rsynd and after changes, do the rest? How do I tell whether rsync has actually modified any files after the first rsync?