Remember the eccentricities of rsync trailing slash behavior:
rsync /path/to/dir1 /other/path/to/dir2results in the directory /other/path/to/dir2/dir1 synchronizing
with /path/to/dir1, while
rsync /path/to/dir1/ /other/path/to/dir2makes /other/path/to/dir2 itself sync with /path/to/dir1. (A
trailing / on the target directory makes no difference.) Here, we'll
consistently use the second (trailing /) version to try to avoid
confusion.
Compare two directories and all their contents in the usual rsync way, by name, size, and modification time:
rsync -rltni dir1/ dir2/