rsync: How to Exclude a Destination Folder
In another installment of things you already know, unless you don’t, today I learned that excluding a folder with rsync actually excludes the path from the operation. Meaning: source and destination are treated as root for the exclusion, like this:
rsync -av --delete --progress --exclude "/folder/to/exclude" /source/ /destination/
If a match exists on either side, it will be excluded from the sync operation.