How to exclude directories while using rsync

Sometimes when you copy a lot of data with rsync you may to exclude some sub-directories. You can do this by using –exclude. For instance, you want to copy files from /mnt to /home/destination_dir/, and you want to exclude directory /mnt/dir1/dir2/. rsync -az –exclude=’dir1/dir2/’ /mnt/ /home/destination_dir/ A lot of users do mistake when specifing path.…