![]() Some examples of regular expression filters are shown below: # always include sqlite databases ![]() If a match is not found, the path will be excluded if all patterns are include patterns, but included otherwise. If a match with an exclude pattern is found, the path is said to be excluded without further comparison. If a match with an include pattern is found, the path is said to be included without further comparisons. ![]() Therefore, the order of the patterns is significant. When matching a path against a list of patterns, the path is compared with the part after “i:” or “e:” one pattern at a time. Regular expression syntax is the same general syntax used by Perl, Python, and other languages.įull details for the supported regular expression syntax and features are available here. The part of the filter after the include/exclude prefix must be a valid regular expression. To include files in a directory and exclude its subdirectories: -folder/*/*Īn include pattern starts with “i:”, and exclude pattern starts with “e:”. To include a directory while excluding all files under that directory, use these patterns: +cache/ The following pattern list includes only files under the directory foo/ but not files under the subdirectory foo/bar: -foo/bar/ Here is the correct way to include foo as well: +foo/bar/* So, we have to make sure foo/ is included first, before the wildcard excludes it. It also excludes all other top-level directories, producing an empty backup. That means that it never goes to the second level into foo/, and therefore never sees a match for foo/bar/. So when duplicacy examines the first level of the file tree for matches and exclusions, it excludes foo/ and everything underneath. This makes the search much more efficient, but can produce confusion about the order an interpretation of filter rules.įor instance, the following pattern list doesn’t do what is intended, since the foo directory will be excluded so the foo/bar will never be visited: +foo/bar/* This is because duplicacy considers all matches and exclusions at each level in the file tree before descending into the next level (a “breadth first” search for matches). Therefore, to include a subdirectory, all parent directories must be explicitly included. When a directory is excluded, all files and subdirectories under it will also be excluded. Patterns ending with “*” and “?”, however, apply to both directories and files. Patterns ending with a “/” apply to directories only, and patterns not ending with a “/” apply to files only. When matching a path against a list of patterns, the path is compared with the part after “+” or “-”, one pattern at a time. Note that both “*” and “?” will match any character including the path separator “/”. Patterns may contain wildcard characters “*” which matches a path string of any length, and “?” matchesĪ single character. Wildcard MatchingĪn include pattern starts with “+”, and an exclude pattern starts with “-”. The path separator is always a “/”, even on Windows. As the upmost folder on Windows is a drive, this means drive letters are not part of the path of a pattern. You may use one method exclusively or you may combine them as you deem necessary.Īll paths are relative to the repository (the folder you execute duplicacy from), without a leading “/”. For the restore command, the include/exclude patterns are specified as the command line arguments.ĭuplicacy offers two different methods for providing include/exclude filters, wildcard matching and regular expression matching. For the backup command, the include/exclude patterns are read from a file named filters under the.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |