2
0
mirror of https://github.com/meganz/MEGAcmd synced 2025-08-31 05:45:11 +00:00

Add help for the sync-ignore command

Also update help for the exclude command to reflect the latest changes.
This commit is contained in:
Diego Ximenez
2024-08-13 18:07:35 +02:00
parent 16d31b36cc
commit f7e17150bc
5 changed files with 103 additions and 15 deletions

View File

@@ -1,15 +1,14 @@
### exclude
Manages exclusions in syncs.
Manages default exclusion rules in syncs.
Usage: `exclude [(-a|-d) pattern1 pattern2 pattern3]`
<pre>
These default rules will be used when creating new syncs. Existing syncs won't be affected. To modify the exclusion rules of existing syncs, use sync-ignore.
Options:
-a pattern1 pattern2 ... adds pattern(s) to the exclusion list
(* and ? wildcards allowed)
-d pattern1 pattern2 ... deletes pattern(s) from the exclusion list
Caveat: removal of patterns may not trigger sync transfers right away.
Consider:
a) disable/reenable synchronizations manually
b) restart MEGAcmd server
This command is DEPRECATED. Use sync-ignore instead.
</pre>

View File

@@ -0,0 +1,46 @@
### sync-ignore
Manages ignore filters for syncs
Usage: `sync-ignore [--show|--add [filter1 filter2 ...]|--remove [filter1 filter2 ...]] (ID|localpath)`
<pre>
If no path or sync ID is provided, the default mega ignore filters will be selected.
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.
Options:
--show Show the existing filters of the selected sync
--add Add the specified filters to the selected sync
--remove Remove the specified filters from the selected sync
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
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
Default is `a`
<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
Default is `n`
<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
Default is `G`
<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>