The option „Remove files not on source“ is available only for one-way syncs and you can find it in the Destination tab in the sync item’s settings. If enabled, all files and directories that are not on the source (anymore) and are not excluded will be removed.
The option „Remove excluded files“, which you can find in the Advanced tab in the sync item’s settings, deletes all files that are excluded by any of the filters in the Exclude tab. As an example, this option can be useful to delete hidden files left over by a previous copy performed in the Finder. In this case it is recommended to enable this option only at the beginning, run the sync once, and then keep it disabled, so that it will leave hidden files such as .DS_STORE files (which store Finder metadata) and the .Spotlight-V100 directory (which contains the Spotlight index) alone.
You can set each sync item to exclude specific files. Excluded files are simply ignored: they are neither copied, nor overwritten, nor removed (unless the option „Remove excluded files“ is enabled). However, excluded files inside directories to be removed are only preserved if they are explicitly included (i.e. they appear in the „Following files“ section described afterwards).
In the Exclude tab of a sync item’s settings you will find the following options.
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 for example to store information about the position of icons. The .Spotlight-V100 directory is created whenever a volume is indexed by Spotlight, the search engine on the Mac, and can also be safely excluded.
After enabling the check box „Filenames containing any of the following words“, you can enter a list of tokens which are checked against each filename 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 a token into a regular expression and/or from exclusive to inclusive by clicking on the small triangle on its right. Tokens at the start of the text field have higher priority, meaning that if a file is matched by an inclusive token but also by a following exclusive token, it will be included.
Be careful when using inclusive tokens in combination with explicitly excluded directories (see below): since inclusive tokens always cause excluded directories to be scanned, this could lead to higher than normal scanning time.
Exclude a specific file
Add a file to the list under the „Following files“ check box by clicking on the „+“ button. Files 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 for 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, or to sync regular files or file packages that you cannot select individually as a source.