Filters
You can configure the app to exclude certain files and folders in 2 locations:
- By clicking the Subfolders.. button in the Task properties page.
- By clicking the Filters.. button in the Task properties page. This method is described in the follwing paragraphs.
Built-in filters
SyncFolder uses the following built-in rules to exclude certain files and folders from copying:
-
The following folders/subfolders will not be copied:
- system volume information
- $recycle.bin
- $windows.~bt
- $windows.~ws
- onedrivetemp
-
The following folders will not be copied when present on the source root location:
- config.msi
- documents and settings
- program files
- program files (x86)
- programdata
- recovery
-
The following 'System' files will not be copied:
- pagefile.sys
- swapfile.sys
- hiberfil.sys
- If the above folders and files also exist on the target drive and the task is a 1-way or 2-way sync task then these folders and files will also never be deleted on the target.
User defined filters
The built-in filters are often not enough for excluding certain files and folders. SyncFolder therefore allows the user to define additional filters. Do this by clicking the Filters button in the task configuration window.
- Exclude complete folders - List the folders that you want to exclude completely by defining a folder name/pathname matching pattern in the top text box. SyncFolder supports old style DOS filter expressions (using * wildcard characters).
- Exclude system files/folders and hidden files/folders - Check the appropriate checkbox if you don't want to copy system and/or hidden files and folders.
-
Include or Exclude files - The app offers 2 ways for specifying the files that you want to copy or dont want to copy.
- Copy all files except those that you list as to be excluded - You can list the files that you don't want to copy in the 'Files to be excluded' text box. List them with their full name/pathname, extension name, or a file matching pattern to exclude multiple files. The matching pattern must be formatted according to the old style DOS filter pattern (using '*' wildcard characters).
-
Copy only specific files - If you select this option then you MUST specify the files that you want to copy in the
'Files to be included' text box. Again, list them using their full name/pathname, extension name or a matching pattern.
You can then still explicitly exclude files that would match the 'include' list by defining them in the 'Files to be excluded' text box.
File and folder matching principles
The app allows you to define multiple file/folder matching patterns. You list them in the
appropriate textbox using a comma (,) to seperate the patterns from each other.
The asterisk (*) and question mark (?) can be used as wildcard characters, as they are in MS-DOS and Windows. The asterisk matches any
sequence of characters, whereas the question mark matches any single character.
The following principles apply:
-
Filter with extension name - A extension name filter starts with a period (.) followed by 1 or more characters. When defined,
the app will extract the extension name of all files in all directories, and match it with the definition.
Example: «.txt»
The app will match all files (or folders in case of a folders filter) in all directories that have .txt as extension name. -
Filter with just a name - Such filter can but musn't contain wildcard characters. When defined, the app only looks at
the name of files (including the extension name) in all directories, and match that name with the definition. The file path is not taken into
consideration.
Example 1: «mydocument.docx»
The app will match all files (or folders) in all directories that have 'mydocument.docx' as name.Example 2: «AlbumArt_*»
The app will match all files in all directories that have a file name that starts with 'AlbumArt_'. -
Filter with a pathname - This filter behaves the same as the previous one except that a full or partial file/folder
pathname is defined. This allows you to restrict the lookup to only specific file and folder pathnames. The pattern can have
wildcard characters in order to match multiple files/folders with a single definition.
Attention: When pathnames are defined the app applies the pattern to file and folder pathnames that are relative to the folder that is assigned to the source location! The pattern definition must be set accordingly.
Example 1 - A root-relative pattern: «\mydocuments\archive»
To restrict matching to root pathnames you have to add a leading slash «\» to the path name.
Assume c:\projects is the assigned folder for the source location then the following folders will match or will not match:
c:\projects\mydocuments\archive: match
c:\projects\android\mydocuments\archive: no matchExample 2 - Root-relative pattern with wildcard: «\android\backup*»
The app will match all folders (or files if appropriate) that have '\android' as root folder and a folder name that starts with 'backup'.
Assume c:\projects is the assigned folder for the source location then the following folders will match or will not match:
c:\projects\android\backup: match
c:\projects\android\backup-20210810: match
c:\projects\backup\android\backup: no match
Example 3 - Filter root-relative subfolder paths: «*mydocuments\archive»
The app will find a match for all folder pathnames (or file pathnames if it is a file filter) in all directories that have 'mydocuments\archive' in their path. The reason it looks in every directory is because there is a leading '*' character in the pathname pattern.
Assume c:\projects is the assigned folder for the source location then the following folders will match or will not match:
c:\projects\mydocuments\archive: match
c:\projects\android\mydocuments\archive: match
c:\projects\android\archive: no match
Last modified: january 27, 2024