From 1efb543ad886480b4c3038e33c439540fbb948bb Mon Sep 17 00:00:00 2001 From: edwardxml <56691903+edwardxml@users.noreply.github.com> Date: Wed, 10 Feb 2021 18:09:48 +0000 Subject: [PATCH] docs: add a Windows example to the filtering docs Add an example pinched from rclone forum https://forum.rclone.org/t/need-help-to-understand-filtering-commands/22196 Credit to @asdffdsa --- docs/content/filtering.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/content/filtering.md b/docs/content/filtering.md index 9b6b74515..7f8ed2fa4 100644 --- a/docs/content/filtering.md +++ b/docs/content/filtering.md @@ -78,6 +78,24 @@ separator or the beginning of the path/file. - doesn't match "afile.jpg" - doesn't match "directory/file.jpg" +The top level of the remote may not be the top level of the drive. + +E.g. for a Microsoft Windows local directory structure + + F: + ├── bkp + ├── data + │ ├── excl + │ │ ├── 123.jpg + │ │ └── 456.jpg + │ ├── incl + │ │ └── document.pdf + +To copy the contents of folder `data` into folder `bkp` excluding the contents of subfolder +`excl`the following command treats `F:\data` and `F:\bkp` as top level for filtering. + +`rclone copy F:\data\ F:\bkp\ --exclude=/excl/**` + **Important** Use `/` in path/file name patterns and not `\` even if running on Microsoft Windows.