Note also that the -include and -exclude options take one pattern each. Note that when used with -r (which is implied by -a), every subcomponent of every path is visited from top down, so include/exclude patterns get applied If no matching include/exclude pattern is found then the filename is not skipped.
If it is an include pattern then that filename is not skipped.
If it is an exclude pattern, then that file is skipped. When a filename is encountered, rsync checks the name against each exclude/include pattern in turn. Rsync builds an ordered list of include/exclude options as specified on the command line. The exclude and include patterns specified to rsync allow for flexible selection of which files to transfer and which files to skip. Note that in all cases (other than listing) at least one of the source and destination paths must be local. This is done the same way as rsync transfers except that you leave off the local destination. This is invoked when the destination path contains a :: separator. # for copying from the local machine to a remote rsync server. This is invoked when the source path contains a :: separator or a rsync:// URL. # for copying from a remote rsync server to the local machine. This is invoked when the source contains a : separator. # for copying from a remote machine to the local machine using a remote shell program. This is invoked when the destination path contains a single : separator. # for copying from the local machine to a remote machine using a remote shell program as the transport (such as rsh or ssh). This is invoked when neither source nor destination path contains a : separator There are six different ways of using rsync.