UI escaping filters wrongly

Hi there,

I’m having issues setting up exclude filters in the Duplicati UI.
The filters did not execute correctly, and I think I found why.

My Filters look like this:
grafik
The above marked being an “Exclude Folder” and the lower a simple Exclude. Both have the same content. Yet, only the lower one works.
Looking at the generated command (Export->Commandline) shows that the above creates
–exclude=“F:\Fotos\\”
while the lower one creates
–exclude=“F:\Fotos\”

This also happens if I set up an “exclude File” Filter with content “F:\abc.jpg”. Result: --exclude=“F:\abc.jpg\”
Or to other File oder Folder pre-defined filter types.

So the pre-defined filter cases always add two more \ than necessary.
Why does this happen and is there a way to avoid this "over-escaping?

regards,
Fabian

Duplicati - 2.0.5.1_beta_2020-01-18
Windows 10
Firefox 73.0.1 (but same issue with Edge)

1 Like

Welcome to the forum!

Yes, this is a known problem. You should be able to work around it by using “Edit as text” option and then remove the extra backslash. Folder exclusions should end in a single backslash as seen on the “Edit as text” screen.

Example:

This SHOULD be correct for excluding D:\Temp:

Click the three dot menu and then “Edit as text”. There are two backslashes after D:\Temp - only one should have been added automatically behind the scenes:

Manually remove one of the backslashes and click Next and finally Save your backup config, and it should work ok:

Hopefully this bug in the UI will be resolved soon.

1 Like

Good to know this is a known bug… I am surprised that I didn’t find a prominent notice of this anywhere.
My workaround was to filter using Type “Filter (exclude)” as I can manually control the syntax there. I didn’t even know about the “Edit as text” option :thinking:

I would rate this bug pretty severe though, as the filters simply don’t apply if used like this, so exclusions do not happen, and there’s also no notice about this in the logs… I actually found out by accident because my backup size was much more than expected.

Thanks so far!
regards,
Fabian

PS: is there a full documentation anywhere stating what the filter groups actually filter? “System Files” or “hidden files” is pretty clear but what is excluded by “Temporary files”?

It was known in still-not-enough-detail-to-fully-describe on the day before your original post here.

Filter “Exclude directories whose name contains” doesn’t exclude the given directory #4090

If you’re good with filters, you can (if you like) comment or test results that you see as suspicious.
The current theory is that a fix for a bug had bad side effects, but I think it’s still being looked into.
Note that this has no effect on existing filters. Creating filters is a bit of an art, and test is advised.

Getting help from the Command Line Tools is probably the best way, because it’s tailored for your particular installation. Temporary files vary with operating system and the user Duplicati is run as. Assuming you’re not on Windows service install, you’re running Duplicati as you, and can run this:

C:\Program Files\Duplicati 2>Duplicati.CommandLine.exe help filter-groups

Example output:

    TemporaryFiles: Files and folders that are known to be storage of
    temporary data.
     Aliases: Temp,TempFiles,TempFolders,TemporaryFolders,Tmp
      *.tmp
      *.tmp\
      *\$RECYCLE.BIN\
      *\AppData\Local\Temp*
      *\AppData\Temp*
      *\Local Settings\Temp*
      ?:\Windows\Temp*
      C:\Users\<user>\AppData\Local\Temp\

For a Windows service, try Using the Command line tools from within the Graphical User Interface.

Thanks for the hint with the command line tool to figure out the groups.
I need to look into this.

About the filters:
I only use pretty basic filters and I absolutely stay away from RegEx…for me this is sort of black magic.
But finding out that the basics don’t work in the first place was tricky already.
In the previous Duplicati 1.3 testing was much easier, because there was a test button. Here I needed to plow through a lot of docs first to find out how to test at all.
So there’s plenty of room for improving usability.

I’d love to help here but I wouldn’t know where to start…my first guess would be to skip escaping strings that are not RegEx…

regards,
Fabian

This change should fix the issue…