The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

App::MtAws::Filter

(I)

filter, include, exclude options allow you to construct a list of RULES to select only certain files for the operation.

(II)

--filter Adds one or several RULES to the list of rules. One filter value can contain multiple rules, it has same effect as multiple filter values with one RULE each.

--filter='RULE1 RULE2' --filter 'RULE3' is same as --filter 'RULE1 RULE2 RULE3'

RULES: [+-]PATTERN [+-]PATTERN ...

RULES should be a sequence of PATTERNS, prepended with '+' or '-' and separated by a spaces. There can be a space between '+'/'-' and PATTERN.

'+' means INCLUDE PATTERN, '-' means EXCLUDE PATTERN

Note: If RULES contain spaces or wildcards, you must quote it Note: although, PATTERN can contain spaces, you cannot use if, because RULES separated by a space(s). Note: PATTERN can be empty

--include=PATTERN Adds an INCLUDE PATTERN to list of rules

--exclude=PATTERN Adds an EXCLUDE PATTERN to list of rules

Note: You can use spaces in PATTERNs here

(III)

PATTERN:

1) if the pattern starts with a / then it is anchored to a particular spot in the hierarchy of files, otherwise it is matched against the final component of the filename. 2) if the pattern ends with a / then it will only match a directory and all files/subdirectories inside this directory. It won't match regular file. Note that if directory is empty, it won't be synchronized to Amazon Glacier, as it does not support directories 3) if pattern does not end with a '/', it won't match directory (directories are not supported by Amazon Glacier, so it has no sense to match a directory without subdirectories). However if, in future versions we find a way to store empty directories in glacier, this behaviour could change. 4) Wildcard '*' matches any path component, but it stops at slashes. 5) Wildcard '**' matches anything, including slashes. 6) When wildcard '**' meant to be a separated path component (i.e. surrounded with slashes/beginning of line/end of line), it matches 0 or more subdirectories 7) Wildcard '?' matches any character except a slash (/). 8) if the pattern contains a / (not counting a trailing /) then it is matched against the full pathname, including any leading directories. Otherwise it is matched only against the final component of the filename. 9) if PATTERN is empty, it matches anything. 10) If PATTERN is started with '!' it only match when rest of pattern (i.e. without '!') does not match.

(IV)

How rules are processed:

1) A filename is checked agains all rules in the list. Once filename match PATTERN, file is included or excluded depending of what kind of PATTERN matched. No other rules checked after first match.

2) When traverse directory tree, unlike Rsync, if a directory (and all subdirectories) match exclude pattern, process is not stopped. So

--filter '+/tmp/data/a/b/c -/tmp/data -' will work (it will match /tmp/data/a/b/c)

3) In some cases, to reduce disk IO, directory traversal into excluded directory can be stopped. This only can happen when mtgalcier absolutely sure that it won't break (2) behaviour. It's guaraneed that traversal stop only in case when a) directory match EXCLUDE rule without '!' prefix, ending with '/' or '**', or empty rule "dir/" "/some/dir/" "prefix** "/some/dir/prefix** b) AND there is no INCLUDE rules before this exclude RULE

4) When we process both local files and Journal filelist (sync, restore commands), rule applied to BOTH sides.