This overview of the "Filters" section of Job Options applies to both GoodSync for Windows and GoodSync for Mac unless noted otherwise.
- Include Filters
- Exclude Filters
- Exclude empty folders
- Exclude Hidden files and folders
- Exclude System files and folders
- Exclude Temporary files and folders
- Copying and pasting Filters
- Adding Filters from the Context Menu after Analyze
- Filter syntax and parameters
Include (empty by default)
If not empty, files and folders whose names match an inclusion filter – and do not match any exclusion filters – are included in the synchronization.
Exclude (empty by default)
Files and folders that match an exclusion filter will be excluded from synchronization.
NOTE: By design, exclusions will take priority over inclusions.
Exclude empty folders (unchecked by default)
If checked, Exclude folders that are empty or contain only empty folders. Folders are considered empty if they contain no files or only files excluded by Filters.
Exclude Hidden files and folders (by default, checked in sync jobs, unchecked in backup jobs)
Exclude files and folders that have a "Hidden" attribute.
Exclude System files and folders (by default, checked in sync jobs, unchecked in backup jobs)
Exclude files and folders that have a "System" attribute.
Exclude Temporary files and folders (Windows only, checked by default)
Exclude temporary files and folders that are not worth saving.
Copying and pasting Filters
Use the "Copy All" and "Paste" buttons to copy and paste filters between the Include and Exclude sections as well as between the jobs.
Adding Filters from the Context Menu after Analyze
The easiest way to exclude or include a file or group of files is to perform an analysis and then right-click the file or folder and select one of the exclusion/inclusion commands:
- Exclude "/FolderName/FileName" file or folder: Exclude only this file or folder, as specified by its complete path "/FolderName/FileName".
- Exclude All "ItemName" files or folders: Exclude all files or folders (in any of the subfolders) that are named "ItemName".
- Exclude All "*.ext" files: Exclude all files that have the extension "ext", in all sub-folders.
-
Include Only "/FolderName/FileName" file or folder:
Include only this file or folder, as specified by its complete path "/FolderName/FileName". - Include Only "*.ext" files: Include all files that have the extension "ext", in all sub-folders.
These commands add a line to the list of exclusions/inclusions in "Jobs" >> "Options" >> "Filters."
Filter syntax and parameters
Wildcards
* matches any sequence of characters
? matches an arbitrary single character
[a-z] matches a range of characters, such as a to z
\c matches character "c". Use it when the character to match is * or ? or [
/ separates folders (do not use \ as folder separator, not even in Windows)
path /folder/file
A line that starts with "path /" (or just "/") matches the file or folder path (relative to the sync folder) to a specified wildcard or string.
Examples:
path /folder1/file2.ext – matches file by its path
path /Parent* – matches all paths whose top-level folder is "Parent"
path /[a-z0-9]* – matches all paths whose top-level folders start with characters "a" to "z" or "0" to "9"
path /\[Originals\] – matches all paths whose top-level folder is "[Originals]"
NOTE: An Include filter "path /folder" includes only the /folder itself, but not the files inside. To include files inside this folder, write this clause as "path /folder/*".
name filename/foldername
A line that starts with "name" matches the file or folder name (last object of the path) to a specified wildcard or string.
Examples:
name *.xls – Excel files
name *kiss* – files or folders that contain "kiss" in their name
name *.??? – all files and folders with a 3-character extension
name *.[a-z][a-z][a-z] – all files and folders with 3-letter extension
name \[Originals\] – matches all file and folders named "[Originals]"
size value
Lines that start with "any size" or "all size" allow exclusion/inclusion of files by file size:
any size<N
means size.left<N OR size.right<N
all size<N
means size.left<N AND size.right<N
any size>N
means size.left>N OR size.right>N
all size>N
means size.left>N AND size.right>N
any size=N
means size.left=N OR size.right=N
all size=N
means size.left=N AND size.right=N
any size!=N
means size.left!=N OR size.right!=N
all size!=N
means size.left!=N AND size.right!=N
any size>=N
means size.left>=N OR size.right>=N
all size>=N
means size.left>=N AND size.right>=N
any size<=N
means size.left<=N OR size.right<=N
all size<=N
means size.left<=N AND size.right<=N
any size[S1,S2]
means S1 <= size.left < S2 OR S1 <= size.right < S2
all size[S1,S2]
means S1 <= size.left < S2 AND S1 <= size.right < S2
K = kilobytes
M = megabytes
NOTE: No spaces are allowed in the "size" match line. The size of non-file items (folder, link, deleted or not-present file) is considered to be 0 for the "size" comparisons.
Examples:
all size>=100 – files on both sides that contain 100 bytes or more
any size<2K – files that contain less than 2,048 (1K = 1024) bytes on either the left or right side, links, and deleted files are OK too
all size=3M – files that contain exactly 3,145,728 bytes (1M = 1024 * 1024) bytes on both sides
time value
Lines that start with "any time" or "all time" allow exclusion/inclusion of files by modification date:
any time<T
means time.left<T OR time.right<T
all time<T
means time.left<T AND time.right<T
any time>T
means time.left>T OR time.right>T
all time>T
means time.left>T AND time.right>T
any time=T
means time.left=T OR time.right=T
all time=T
means time.left=T AND time.right=T
any time!=T
means time.left!=T OR time.right!=T
all time!=T
means time.left!=T AND time.right!=T
any time>=T
means time.left>=T OR time.right>=T
all time>=T
means time.left>=T AND time.right>=T
any time<=T
means time.left<=T OR time.right<=T
all time<=T
means time.left<=T AND time.right<=T
any time[S1,S2]
means S1 <= time.left <= S2 OR S1 <= time.right <= S2
all time[S1,S2]
means S1 <= time.left <= S2 AND S1 <= time.right <= S2
Where T is a date in one of these formats:
- YYYY/MM/DD – year/month/day
- -Nd – N days ago
- +Nd – N days in the future
- -Nh – N hours ago
- +Nh – N hours in the future
- -Nm – N minutes ago
- +Nm – N minutes in the future
NOTE: No spaces are allowed in the "time" match line.
Only existing (not deleted) files are meant to take part in "time" comparisons.
The modification time of non-file objects (folders, links, deleted files) is considered to be NullTime (Jan 1, 1970).
Examples:
any time>=2008/7/4 – files modified at 00:00 on July 4, 2008, or later on either side
all time<-5d – files older than 5 days ago on both sides
time>=+7d – files modified 7 days in the future or later on either side
is-x
Lines that start with "is" match file and folder attributes:
isfolder
matches a folder
isfile
matches a file
issymlink
matches symbolic link or junction
ishidden
matches files and folders with a hidden attribute
issystem
matches files and folders with a system attribute (Windows only)
isarchive
matches files and folders with an archive attribute (Windows only)
isreadonly
matches files and folders with a read-only attribute (Windows only)
isoffline
matches files and folders with an offline attribute (Windows only)
iscompressed
matches files and folders with a compressed attribute (Windows only)
isencrypted
matches files and folders with an encrypted attribute (Windows only, EFS encryption)
exist-x
Lines that start with "exist" match facts of the presence and absence of files and folders.
existboth
file or folder exists both on the left and right side
existany
file or folder exists on the left, right side, or both sides
existone
file or folder exists only on one side