Filters
The -i or IncludePattern option allows you to limit synchronization to files matching the given patterns. You may specify multiple patterns in a single option.
Each pattern will be matched against the base name of local and remote files. Non-matching files will not be copied or deleted. Filters are only applied to the base names of regular files and symbolic links. Filters are applied after scanning and will not reduce the time it takes to scan.
Syntax
The IncludePattern takes the form of a semi-colon separated list of glob-like patterns with similar syntax to the Linux fnmatch function. They work like typical shell globbing, with the following distinctions:
- ASCII Roman letters are case-insensitive.
- Multiple patterns may be separated by semi-colons.
- Each pattern must be less than 254 bytes under UTF-8 encoding.
- If no wildcards, escapes, or semi-colons are present, an asterisk will be placed at the start, end, and between all words.
- A ! character at the start of the string will negate the entire result: matching names will be excluded.
For example, "*.pdf;*.txt;*.doc" will match only files with the extension PDF, TXT, or DOC.
Remember that in most shell environments, the * character must be quoted or escaped on the command line to avoid shell globbing.
See Also
The ExcludePath option has simpler syntax and is applied to the entire relative path of both files and folders.