In the Filters tab of a sync item’s settings you will find the following options: exclude hidden files, filter files with a given expression, and filter selected files. Selected excluded files (which we also refer to as explicitly excluded files) are never copied nor deleted (unless you enable the option “Remove excluded files”): this allows you to exclude an entire directory on the source that you don’t want to copy because it’s too big or unnecessary, and it allows you to exclude an entire directory on the destination that is not present on the source but you want to keep on the destination nonetheless. Files excluded because they’re hidden or match one of the given expressions are never copied, but a folder that is not on the source anymore can still be deleted even if it contains such excluded files (provided you enable the option “Remove files not on source”).
Exclude hidden files
Files or directories which start with a dot are hidden in the Finder. Most of the times these files are used to cache data and can be recreated by macOS if necessary. For example, “.DS_Store” files are created by the Finder when opening a directory and are used to store information about the position of icons. If the confirmation dialog lists hidden system directories like “.DocumentRevisions-V100”, “.Spotlight-V100”, “.TemporaryItems” or “.Trashes”, it usually means that you have selected an external device’s root folder as the source and/or destination; instead, it is recommended that you create a dedicated directory to store your backup so that these hidden directories managed by the operating system don’t get in the way.
Excluding hidden files can be convenient if you know well all the important data that you want to back up and don’t care about files you can’t see in the Finder. If you are unsure, try to run a sync without any exclude filter and in the confirmation dialog check if there are any files you don’t care about. If you find that after all you need some of the hidden files, you can simply exclude the unwanted files with one of the filters below. For example, if you don’t care about the “.DS_Store” files but want to copy other hidden files, just add “.DS_Store” as a filename filter below.
Filename and tag filters
After enabling the check box “Filter files matching any of the following expressions”, you can enter a list of expressions which are checked against each filename (the default) in order to determine if it should be excluded or not. After typing an expression, you have to press Return in order to tokenise it. You can then turn an expression into a regular expression, turn it from exclusive to inclusive and set it to apply to tags rather than filenames by clicking on the small triangle on its right. Expressions at the start of the text field have higher priority.
Be advised that, when using inclusive expressions in combination with explicitly excluded directories (see below), this could lead to higher than normal scanning time, since inclusive expressions always cause excluded directories to be scanned. Still, explicitly excluded directories in combination with inclusive expressions can be a convenient way of syncing only files matching a specific expression: for example, you could add the source directory itself to the list of explicitly excluded files (see below) and then add one or more inclusive expressions, so that the destination will end up with only the files matching these expressions.
Filter a selected file
Add a file or directory to the list under the “Filter following files” check box by clicking on the “+” button. Files at the top level are excluded by default. Further entries inside excluded directories will be included, and vice versa; you can alternate as many excluded and included files as you want. Excluded and included files apply to both source and destination. Files contained in included directories can still be excluded and files contained in excluded directories can still be included by the above filters.
You may want to exclude the source directory itself and include some of the contained directories as a means of grouping together many sync items with a common parent directory and the same settings.