Filter syntax does not work

Can’t make a backup with Duplicati in which I save a folder, but exclude some sub-folders!
Regardless of which syntax I set for the folders, they are always backed up!

The folder to be backed up is on “P: ! Todo” and below that the folders “2000 - 2010” and “2011-2020” should be excluded from the backup!

I’ve already looked at the documentation,

but I can’t find a solution there

Can someone help me with the CORRECT syntax for a filter?

Tried:
-“P:!Todo\2000 - 2010”\
or
-P:!Todo\2000 - 2010\\

or
-!Todo\2000 - 2010\
nothing worked

If I backup folder C:\!ToDo without a filter, I get this:

image

Adding

image

gets

image

Filters article says that folder names always end with a backslash on Windows.
Additional double quotes are not mentioned, and only relevant on command line.

This adds some other odd special cases, e.g.a trailing quoted backslash is \\"
It’s the same sort of escape-character plan that posting in the forum falls into…
If you need to post more, put three backticks (```) before and after to stop that…

EDIT:

The TEST-FILTERS command exists, but beware of Command Prompt quoting.
You’d also be calling for exclude with an --exclude option instead a minus sign.

I have now built a test environment!
If I paste and save the folder with copy & paste (see image 1) image1
and then open it as a list view, my entry gets “3 x \” at the end (image2)image2.
If I delete this “\” and save again, then it works! (image3) image3
i think that it is a bug!

Another question:
What should the syntax look like in the list view if there are spaces in my folder?

Original post looked like you were comparing “Edit as text” with the manual (then forum mangled text).
If you were using the GUI filter dropdown, then you probably hit this bug which is fixed in the next Beta:

I’m still not sure the GUI filter builder is exactly right, but at least it looks like it doesn’t do extra slashes.

It should have spaces. Don’t quote unless you’re trying to protect from Command Prompt, bat file, etc.

I had a lot of trouble with filters on Windows, too. The workaround that I used was to choose the “exclude regular expression” option (sorry, I don’t know what it looks like in Deutsch!). The syntax for regular expressions can catch you out if you are not used to it, but here is an example that excludes a folder and all of its subfolders for me:

D:\\work\\gml\\mikado\\.*$

The key things that I believe are important:

  1. Type the whole path, starting from the root drive.
  2. Be careful to match the exact letter-case, even though file names are not case-sensitive in Windows (I use whatever the ‘dir’ command in a Command Prompt shows me).
  3. Use two backslashes to separate each folder (for the regex syntax).
  4. End with the sequence \\.*$. This tells Duplicati to include everything (folders, sub-folders, files) whose path name starts with that string.

You can get clever with the regex syntax if you know what you are doing, but be aware that there is a bug where Duplicati adds its own ^ at the start of the expression. This is why you have to include the whole path from the root folder.

So, in your case, I would try this:

C:\\!ToDo\\2000-2010\\.*$

If that still doesn’t work, maybe Duplicati is treating the hyphen as a meta character, so try escaping that as well:

C:\\!ToDo\\2000\-2010\\.*$

but I think it shouldn’t be necessary.

I fixed it already, sorry for delay!
The problem was that the filter function adds some backslashes, which are wrong, when you make the entry via “edit as list”!
If you switch to “edit as text” after the input and remove the unnecessary characters, then it works!
I can’t tell why the characters are inserted there, probably a bug when translating the input !?

Conclusion: My backup is now also running with spaces in the folder name with the following Exclude config (as Text):

Syntax (2)

In addition, I have folders with “.NoBack” in their names, which I don’t want to save either. I have this done with the syntax:

Syntax2

also works :wink:

This is a known bug in 2.0.5.1 and has been fixed in the Canary channel. The next beta should be better!