FreeFileSync Open Source File Synchronization

About Tutorials Screenshots Vision Download Archive Forum F.A.Q. Manual Donate
It looks like an ad blocker has blocked the ads. Donate now The FreeFileSync project is 100% dependent on ad revenue and donations to stay alive. Instead of the ads, and after FreeFileSync has proven useful to you, please think about supporting with a donation.
FreeFileSync User Manual:

Exclude Files and Folders with Filter

File exclude filter

Files and folders are considered for synchronization only if they pass all filter rules: They must match at least one entry in the include list and none in the exclude list as shown in the filter configuration dialog.
 
  • Each filter item must be a file or folder path relative to the selected folder pair.
  • Multiple items must be separated by | or a newline.
  • Wild cards may be used:  
    * means zero or more characters
    ? represents exactly one character
    ?* matches one or more characters
  • Filter matching is case-insensitive.

Example: Filtering Items in a Folder Pair

The following filter phrases assume a folder pair C:\Source <—> D:\Target, and they can be used for both the include and exclude filters.
 
Description Filter phrase
Single file (or folder) C:\Source\file.txt \file.txt
Single folder C:\Source\SubFolder \SubFolder\
All files (and folders) named thumbs.db *\thumbs.db
All files (and folders) starting with the Z character *\z*
All *.tmp files (and folders) in C:\Source\SubFolder \SubFolder\*.tmp
Files and folders containing temp in their path *temp*
Multiple entries, separated by a vertical bar *.tmp | *.doc | *.bak
Files/folders inside subfolders of the folder pair *\
All files (but not folders) *:

Example: Complex filter rules with exceptions

Complex filter requirements can often be solved by using two folder pairs with the same source and target paths but different local filters. The first folder pair handles the default case. The second folder pair the exception.
Exclude a subfolder except for *.txt files by using two folder pairs:
C:\Source <—> D:\Target     local exclude filter: \SubFolder\
C:\Source <—> D:\Target     local include filter: \SubFolder\*.txt

Example: Exclude empty folders

Set *: as the include filter to match all files, but not folders. During synchronization some excluded folders will still be created if needed, but only if they contain at least one non-excluded item, that is, when they are not empty.

Note
  • For simple exclusions: Instead of typing the filter phrase manually, go to the FreeFileSync main window, right-click one or more files from the list, and exclude them via the context menu.
  • By default, a filter phrase can match both file and folder paths. To match only one of them, you can give a hint:
    1. Files only: append a colon (:)
    2. Folders only: append a path separator (/ or \)
  • If the filter is matching a folder, all its files and subfolders are also (implicitly) matched. Thus the filter phrases SubFolder\ and SubFolder\* are synonymous.
  • Both slash (/) and backslash (\) can be used as path separators.