Purpose of Filtering
Filtering is designed to help you explore, analyze, and understand the contents of compared Data Sources.
It allows you to focus on files and directories that match specific criteria, making it easier to:
- Inspect differences between Data Sources
- Identify missing, outdated, or unexpected files
- Detect anomalies in large file sets
- Narrow down results when working with large volumes of data
Instead of browsing raw comparison results, filters let you express what you are looking for using clear and precise conditions.
Filtering Syntax
Filters are logical expressions like:
is:file AND name=="report*" AND A1.size>1MB AND NOT on:B1
# filters out files whose name starts with "report", whose size is greater than 1MB and which are not located on the B1 Data Source.Each filter is evaluated for every file or folder, based on its metadata and its presence across the various datasources.
Simple Text Search
Just type plain text to search file and folder names:
report 2025
# Find all files and folders whose name contains both "report" and "2025".Universal Operators
Universal Operators apply directly to files & folders without needing to specify a particular datasource.
| Operator | Example | Description |
|---|---|---|
name | name=="file1.txt" | Exact or pattern match on file name |
on | on:A1 | Checks if the file exists in datasource A1 |
only | only:A1 | True if the file exists only in A1 |
is | is:file | File type: file, dir, or directory |
has:actions | has:actions.copy>0 | Synchronization action: copy, delete, etc. |
Datasource-Specific Operators
These operators compare specific properties of datasources, typically to detect differences.
| Operator | Example | Description |
|---|---|---|
content | A1.content==A2.content | Compares binary content |
content-and-date | A1.content-and-date==A2.content-and-date | Compares content and last-write time |
last-write-time | A1.last-write-time > A2.last-write-time | Compares last modification dates |
size | A1.size != A2.size | Compares file sizes |
Logical Operators
Use logical operators to combine or negate conditions:
- AND:
name:"*.log" AND A1.size>1MB - OR:
is:file OR is:directory - NOT:
NOT name=="temp*" - Parentheses ( … ):
not (A1.size<10KB or name:"temp*")
Comparison Operators
| Operator | Meaning | Example |
|---|---|---|
== or = | Equals | A1.size == 1024 |
!= or <> | Not equal to | A1.size != 0 |
<, >, <=, >= | Comparisons | lastwritetime >= 2025-01-01 |
=~ | Matches regex pattern | name =~ "^report.*\.pdf$" |
Datasources and Inventory Identifiers
ByteSync compares multiple inventory sources called datasources, identified by short codes:
| Identifier | Role |
|---|---|
A | Main inventory of node A |
A1, A2 | Individual file sources under node A |
Filter by name
You can filter files based on their name using the name operator. This is useful to include or exclude files by exact name, pattern, or regular expression.
Basic Comparisons
Use : or == to match files & folders whose name equals the specified value.
name:README.md
name=="file1.txt"
Use != to matches files & folders whose name is different from the specified value.
name!="temp.log"Wildcards
You can use wildcard character (*) to match any sequence of characters.
name:file1*
name==*.logRegular Expressions
Use =~ to match a regular expression pattern:
name=~"^log_.*\\.txt$"
# This matches any .txt file whose name starts with log_.Synchronization Actions can filtered with the has:actions operator.
Actions Sources
| Keyword | Description |
|---|---|
targeted | Match targeted actions |
rules | Match actions resulting of synchronization rules |
Actions Types
| Keyword | Description |
|---|---|
copy | Content and dates of the file will be synchronized |
copy-content | Content of the file will be synchronized |
copy-dates | Dates will be synchronized |
create | Directory will be created |
delete | File/Directory will be deleted |
do-nothing | Do Nothing is set, nothing will be done on File/Directory |
Action Source & Action Type can be omitted, but if both are used, Action Source must be specified before Action Type.
Examples
Files that will be synced (contents & date):
has:actions.copyFiles that will be deleted due to a synchronization rule:
has:actions.rules.deleteFiles that won’t be touched:
has:actions.do-nothingFiles larger than 10 MB on A1:
A1.size > 10485760Files modified since 2024 on B:
B.last-write-time >= 2024-01-01.log files that will be synced:
name == "*.log" AND actions.copyDirectories only:
is:directory
# can also be filtered out with is:dirFiles present only in inventory A:
only:AFiles present in both A1 and B1:
on:A1 AND on:B1Files present in A1 or A2 and B1:
(on:A1 OR on:A2) AND on:B1This syntax gives you precise control over which files are included or excluded from your sync operations.
