2024-08-13 18:07:35 +02:00
|
|
|
### sync-ignore
|
|
|
|
Manages ignore filters for syncs
|
|
|
|
|
2024-10-30 22:38:02 +01:00
|
|
|
Usage: `sync-ignore [--show|[--add|--add-exclusion|--remove|--remove-exclusion] filter1 filter2 ...] (ID|localpath|DEFAULT)`
|
2024-08-13 18:07:35 +02:00
|
|
|
<pre>
|
2024-10-30 22:38:02 +01:00
|
|
|
To modify the default filters, use "DEFAULT" instead of local path or ID.
|
2024-08-13 18:07:35 +02:00
|
|
|
Note: when modifying the default filters, existing syncs won't be affected. Only newly created ones.
|
|
|
|
|
|
|
|
If no action is provided, filters will be shown for the selected sync.
|
2024-10-24 23:16:09 +02:00
|
|
|
Only the filters at the root of the selected sync will be accessed. Filters beloging to sub-folders must be modified manually.
|
2024-08-13 18:07:35 +02:00
|
|
|
|
|
|
|
Options:
|
|
|
|
--show Show the existing filters of the selected sync
|
|
|
|
--add Add the specified filters to the selected sync
|
2024-10-24 22:40:19 +02:00
|
|
|
--add-exclusion Same as "--add", but the <CLASS> is 'exclude'
|
|
|
|
Note: the `-` must be omitted from the filter (using '--' is not necessary)
|
2024-08-13 18:07:35 +02:00
|
|
|
--remove Remove the specified filters from the selected sync
|
2024-10-24 22:40:19 +02:00
|
|
|
--remove-exclusion Same as "--remove", but the <CLASS> is 'exclude'
|
|
|
|
Note: the `-` must be omitted from the filter (using '--' is not necessary)
|
2024-08-13 18:07:35 +02:00
|
|
|
|
|
|
|
Filters must have the following format: <CLASS><TARGET><TYPE><STRATEGY>:<PATTERN>
|
|
|
|
<CLASS> Must be either exclude, or include
|
|
|
|
exclude (`-`): This filter contains files or directories that *should not* be synchronized
|
2024-10-30 22:52:20 +01:00
|
|
|
Note: you must pass a double dash ('--') to signify the end of the parameters, in order to pass exclude filters
|
2024-08-13 18:07:35 +02:00
|
|
|
include (`+`): This filter contains files or directories that *should* be synchronized
|
|
|
|
<TARGET> May be one of the following: directory, file, symlink, or all
|
|
|
|
directory (`d`): This filter applies only to directories
|
|
|
|
file (`f`): This filter applies only to files
|
|
|
|
symlink (`s`): This filter applies only to symbolic links
|
|
|
|
all (`a`): This filter applies to all of the above
|
2024-10-24 23:50:09 +02:00
|
|
|
Default (when omitted) is `a`
|
2024-08-13 18:07:35 +02:00
|
|
|
<TYPE> May be one of the following: local name, path, or subtree name
|
|
|
|
local name (`N`): This filter has an effect only in the root directory of the sync
|
|
|
|
path (`p`): This filter matches against the path relative to the rooth directory of the sync
|
|
|
|
Note: the path separator is always '/', even on Windows
|
|
|
|
subtree name (`n`): This filter has an effect in all directories below the root directory of the sync, itself included
|
2024-10-24 23:50:09 +02:00
|
|
|
Default (when omitted) is `n`
|
2024-08-13 18:07:35 +02:00
|
|
|
<STRATEGY> May be one of the following: glob, or regexp
|
|
|
|
glob (`G` or `g`): This filter matches against a name or path using a wildcard pattern
|
|
|
|
regexp (`R` or `r`): This filter matches against a name or path using a pattern expressed as a POSIX-Extended Regular Expression
|
|
|
|
Note: uppercase `G` or `R` specifies that the matching should be case-sensitive
|
2024-10-24 23:50:09 +02:00
|
|
|
Default (when omitted) is `G`
|
2024-08-13 18:07:35 +02:00
|
|
|
<PATTERN> Must be a file or directory pattern
|
|
|
|
Some examples:
|
|
|
|
`-f:*.txt` Filter will exclude all *.txt files in and beneath the sync directory
|
|
|
|
`+fg:work*.txt` Filter will include all work*.txt files excluded by the filter above
|
|
|
|
`-N:*.avi` Filter will exclude all *.avi files contained directly in the sync directory
|
|
|
|
`-nr:.*foo.*` Filter will exclude files whose name contains 'foo'
|
|
|
|
`-d:private` Filter will exclude all directories with the name 'private'
|
|
|
|
|
|
|
|
See: https://help.mega.io/installs-apps/desktop/megaignore more info.
|
|
|
|
</pre>
|