Using a shell script to check if rsync made any changes
Solution 1:
If you use the -i option (and don't use the -v option), rsync will only print lines to STDOUT for any changes that were made. Depending on your script, this could look like
if [ -n "$(rsync -i /dir1 /dir2)" ]; then
run_command;
fi