Filters
You can add filters where your can configure to include or exclude files and folders based on file type, name, size, file age and modification date. Regular expression filtering is also supported if that is something you are into. Sync filters are specific to the folderPair for which you configure them.
Concept
- A file/folder will be always excluded if it matches at least one exclude filter.
- A file/folder will be included if it matches at least one include filter, it doesn’t have to match all of them.
- If a folder, other than the root folderPair sync folder, is excluded then all of its children file/folders will also automatically be excluded.
- Sub folders of an included folder will not be synced unless they also match a folder include filter.
Exclude filter precedence
If a file or folder matches both an exclude and an include filter, the exclude filter will take precedence and the file/folder will be excluded.
About filter values
- Filter value that is a path should match the relative path in relation to the selected folderPair folder.
- All filters are case-insensitive.
- File extension filters can be for example “jpg” or “doc”. Don’t include leading period.
- If filter value for the folder filters “contains”, “equals”, “startsWith” and “endsWith” contains a forward slash “/” then the filter is applied as a relative path in regards to the folder synced, if not is is compared against folder name only.
Regarding Windows file paths
Windows paths will, in regards to filter comparison, use forward slash "/" as path separator for cross-filesystem compatibility. This means a filter value of for example "/some/folder/" for a folder filter will match a windows path like c:\folderPairFolder\some\folder where c:\folderPairFolder is the configured folderPair folder. Do not use backslash as path separator in a filter.
When using the folder selector function on filter dialog it will convert selected Windows paths to use forward slash.
Regular expression filters
Regex filters are only applied to filename, foldername, the relative path or the file modified timestamp, depending on which type of RegEx filter is chosen.
Info about which regex expressions patterns are supported can be found here.
RegEx filter | What is regular expression matched to |
---|---|
File name RegEx | File name only |
File path RegEx | Relative file path to the sync folder, such as /subfolder/filename.jpg |
File modified time RegEx | The modified time of the file in ISO8601 like pattern such as 2024-05-01T11:57:33Z |
Folder name RegEx | File name only |
Folder path RegEx | Relative folder path to the sync folder, such as /subfolder/another_folder/ |
Examples - include filters
Desired outcome | Include filter to use | Value |
---|---|---|
Include a file abc.txt | File name equals |
abc.txt |
Include all files of type avi | File extension |
avi |
Include a specific folder xyz and all its sub folders | Folder name starts with |
/xyz/ |
Include a specific folder xyz and all files in it, but not subfolders | Folder name equals |
/xyz/ |
Include any folder named xyz and all files in those, but not subfolders | Folder name equals |
xyz |
Include only files with modified time in May | File modified time RegEx |
^(....-05-..T.*) |
Include only files with modified time in 2023 | File modified time RegEx |
^(2023-..-..T.*) |
Include only files with modified time at 14 o'clock | File modified time RegEx |
^(.*T14.*) |
Examples - exclude filters
Desired outcome | Exclude filter to use | Value |
---|---|---|
Exclude all sub folders | Folder name RegEx |
^(.*) |
Exclude hidden files | File name starts with |
. |
Exclude hidden folders | Folder name starts with |
. |
Exclude a file abc.txt | File name equals |
abc.txt |
Exclude all files of type avi | File extension |
avi |
Exclude a specific folder xyz and all its contents | Folder name starts with |
/xyz/ |
Exclude a specific folder and sub folder xy/ab combo anywhere | Folder path RegEx |
^(.*\/xy\/\ab/.*) |
Exclude files in a subfolder but not files in sub folders children folders | File path RegEx |
^(/somefolder/subfolder/(?:(?!/).)*)$ |