Given two directories /.../src and /.../des, they share some subdirectories share1 and share2des also has a subdirectory named des1 which doesn't exist in src.How can I perform file transfer from src to des (by rsync or other program you prefer), in order toupdate share1 and share2 in des according to their samename directories in src, including deleting all the files that are in des/share1 and des/share2 but not in src/share1 and src/share2, adding all the files that are not in des/share1 and des/share2 but in src/share1 and src/share2, and updating all the files that are  in both des/share1 and src/share1  or in both des/share2 and src/share2,keep des/des1 intact? Thanks.
rsync: delete some files in destination not in source but not delete others
rsync;backup
There are two options. Both use rsync.Either: Only update share1 and share2, deleting unknown files in the targetrsync --dry-run -avP --delete .../src/share1 .../src/share2 .../des/Or: Update everything in des, deleting unknown files in the target except for des1rsync --dry-run -avP --delete --exclude '/des1' .../src/ .../des/When you're happy with the result, remove --dry-run.