Filters

The Filters tab of the sync settings allows to selectively exclude and include files.

Note: “file” is a generic term that refers to all kinds of files, such as regular files (text files, PDF files etc.) and directories.

Filter files by expression

After enabling the check box “Filter files matching any of the following expressions”, you can add a list of expressions which are checked against each file. To add a new filter expression, click on the + button and select one of the available expression scopes:

  • Filename
  • Tags
  • Date Modified: doesn’t match directories. A directory’s modification date doesn’t reflect if any of the sub-contents have changed (for example, if a file in a subdirectory is modified, only the parent directory’s modification date is updated, but not the grandparent’s).
  • Age (since date modified): doesn’t match directories.
  • Size: doesn’t match directories. A directory’s size can be ambiguous, particularly if some of the contained subfiles are excluded.
  • Hidden: matches all files hidden in the Finder, including filenames starting with a period.
  • Locked: matches all files that are marked as locked in the Finder.
  • Alias: matches aliases (symbolic links). Symbolic links are a special kind of file that can be created by a program or with the Terminal command ln -s. Aliases created in the Finder are a different kind of file that is not matched by this filter.

Once added, you can edit an expression by double-clicking it:

  • Filenames and Tags: the textual expression can be turned into a regular expression.
  • Date modified: the expression can match dates that come before or after.
  • Age and Size: the expression can match attributes that are bigger or smaller.

Moreover, each expression has one of two modes:

  • Exclude: the default. Matched files are never copied and, if the option “Remove files not on source” is enabled, not checked against the source to determine if they should be removed. They may still be removed if a parent directory is removed.
  • Include: since expressions at the start of the text field have higher priority, by placing an inclusive expression before an exclusive one, you can include a subset of the excluded files again. If you only want to include files matched by the inclusive expressions, you may do so by also adding the source directory itself as an explicitly excluded file (see below).

Note: inclusive expressions cause all directories to be scanned, including explicitly excluded directories (see below), since each directory can potentially contain files matched by an inclusive expression. If you want to avoid scanning excluded directories altogether, you should avoid adding inclusive expressions and add explicitly included files instead (see below).

Filter explicitly selected files

After enabling the check box “Filter following files”, you can add a hierarchy of explicitly filtered files. To add a new file, click on the + button and choose whether the selected file should be excluded or included.

Selected files will be filtered on all sync bases, regardless which base the selected files are actually on. Files contained in included directories can still be excluded and files contained in excluded directories can still be included by a filter expression (see above). There is no limit to how many excluded and included files can be nested inside each other.

Hint: as a means of grouping together many sync items with a common parent directory and the same settings, you can exclude the source directory itself and include the subdirectories you want to sync. For example, if you only want to sync your Documents, Music and Pictures directories but ignore all other files contained in your home directory, select the home directory as the source, add it as an explicitly excluded file, then add Documents, Music and Pictures as explicitly included subfiles.

Hint: if you want to select a file that is hidden in the Finder, you can navigate to it in the open panel by pressing the keyboard shortcut Command-Shift-G, which will open a dialog that allows you to manually enter a path to navigate to. Alternatively, you can toggle the display of hidden files with the keyboard shortcut Command-Shift-.