From 429bb7e8b8378caa80a4d29c0791d8c76584b120 Mon Sep 17 00:00:00 2001 From: Iakov Davydov Date: Thu, 9 Nov 2017 10:40:47 +0100 Subject: [PATCH] docs for --exclude-if-present --- docs/content/filtering.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/content/filtering.md b/docs/content/filtering.md index 4a4c4bbaa..19c2c23f0 100644 --- a/docs/content/filtering.md +++ b/docs/content/filtering.md @@ -421,3 +421,24 @@ In Windows the expansion is done by the command not the shell so this should work fine * `--include *.jpg` + +## Exclude directory based on a file ## + +It is possible to exclude a directory based on a file, which is +present in this directory. Filename should be specified using the +`--exclude-if-present` flag. This flag has a priority over the other +filtering flags. + +Imagine, you have the following directory structure: + + dir1/file1 + dir1/dir2/file2 + dir1/dir2/dir3/file3 + dir1/dir2/dir3/.ignore + +You can exclude `dir3` from sync by running the following command: + + rclone sync --exclude-if-present .ignore dir1 remote:backup + +Currently only one filename is supported, i.e. `--exclude-if-present` +should not be used multiple times.