I would recommend to achieve the goal by just excluding unnecessary files. Example:
rsync -ahPruvz --exclude=Thumbs.db --exclude='target/' --exclude='/home/*/.cache/' --exclude='/home/*/Downloads/' A B
Thumbs.db
is the common garbage file you mentioned. target/
is a common output directory for build tools (java,rust etc). .cache
is a common place to store cache files, which often do not need to be backed up. And so on, just mention the files that annoy you. You will see your diff if you run verbose rsync twice.
While this may not feel like an ideal solution, it does work on practice. The diff for the garbage files goes generally down to < 1 Mb after cleaning the most fat files.