I have a back-up where I’d like to include
(1) all files having “€€” in their filename regardless of the folder they’re in, and
(2) all files that are in folders that have “€€” in their folder name.
For (1), +.*€€[^\\]*
seems to work well.
For (2), neither +.*€€.*\\
nor +.*€€.*\\[^\\]*
or anything else I have tried works: Both expressions in (2) find the folder, but don’t include the files that are in that folder.
(The ultimate task is to combine both (1) and (2) with | into a single expression.)
What am I doing wrong? Thanks!
I would think you could just do a simple regex match for anything that contains “€€” as it would pick up both folders with those characters (and all the contents) as well as individual files with those characters.
I tried testing the regex but had trouble getting it to work with the Euro character for some reason. Not sure why. I tried it with ampersands and it worked as expected:
.\Duplicati.CommandLine.exe test-filter 'C:\Temp2\' --include='[.*@@.*]'
Including source path: C:\Temp2\
Including path due to filter: C:\Temp2\Folder1\ => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder2\ => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder3@@\ => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder3@@\New Text Document - Copy (2).txt => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder3@@\New Text Document - Copy (3).txt => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder3@@\New Text Document - Copy (4).txt => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder3@@\New Text Document - Copy.txt => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder3@@\New Text Document.txt => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder2\@@Test\ => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder2\New Text @@ Document - Copy.txt => ([.*@@.*]) || (*\)
Excluding path due to filter: C:\Temp2\Folder2\New Text Document - Copy (2).txt => null
Excluding path due to filter: C:\Temp2\Folder2\New Text Document - Copy (3).txt => null
Excluding path due to filter: C:\Temp2\Folder2\New Text Document - Copy (4).txt => null
Excluding path due to filter: C:\Temp2\Folder2\New Text Document - Copy (5).txt => null
Excluding path due to filter: C:\Temp2\Folder2\New Text Document.txt => null
Including path due to filter: C:\Temp2\Folder2\@@Test\New Text Document - Copy (2).txt => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder2\@@Test\New Text Document - Copy.txt => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder2\@@Test\New Text Document.txt => ([.*@@.*]) || (*\)
Including path due to filter: C:\Temp2\Folder1\New Text @@ Document - Copy (4).txt => ([.*@@.*]) || (*\)
Excluding path due to filter: C:\Temp2\Folder1\New Text Document - Copy (2).txt => null
Excluding path due to filter: C:\Temp2\Folder1\New Text Document - Copy (3).txt => null
Excluding path due to filter: C:\Temp2\Folder1\New Text Document - Copy.txt => null
Excluding path due to filter: C:\Temp2\Folder1\New Text Document.txt => null
Matched 10 files (0 bytes)
I did seem to have more success using ALT+0128 for the Euro character instead of copying/pasting the symbol from your post here. Duplicati command line outputs the character as ? here but you can see the Inclusions worked:
.\Duplicati.CommandLine.exe test-filter 'C:\Temp2\' --include='[.*€€.*]'
Including source path: C:\Temp2\
Including path due to filter: C:\Temp2\Folder1\ => ([.*??.*]) || (*\)
Including path due to filter: C:\Temp2\Folder2\ => ([.*??.*]) || (*\)
Including path due to filter: C:\Temp2\Folder3@@\ => ([.*??.*]) || (*\)
Including path due to filter: C:\Temp2\Folder4??\ => ([.*??.*]) || (*\)
Including path due to filter: C:\Temp2\Folder4??\New Text Document.txt => ([.*??.*]) || (*\)
Excluding path due to filter: C:\Temp2\Folder3@@\New Text Document - Copy (2).txt => null
Excluding path due to filter: C:\Temp2\Folder3@@\New Text Document - Copy (3).txt => null
Excluding path due to filter: C:\Temp2\Folder3@@\New Text Document - Copy (4).txt => null
Excluding path due to filter: C:\Temp2\Folder3@@\New Text Document - Copy.txt => null
Excluding path due to filter: C:\Temp2\Folder3@@\New Text Document.txt => null
Including path due to filter: C:\Temp2\Folder2\@@Test\ => ([.*??.*]) || (*\)
Excluding path due to filter: C:\Temp2\Folder2\New Text @@ Document - Copy.txt => null
Excluding path due to filter: C:\Temp2\Folder2\New Text Document - Copy (2).txt => null
Excluding path due to filter: C:\Temp2\Folder2\New Text Document - Copy (3).txt => null
Excluding path due to filter: C:\Temp2\Folder2\New Text Document - Copy (5).txt => null
Excluding path due to filter: C:\Temp2\Folder2\New Text Document.txt => null
Including path due to filter: C:\Temp2\Folder2\New Text ?? Document - Copy (4).txt => ([.*??.*]) || (*\)
Excluding path due to filter: C:\Temp2\Folder2\@@Test\New Text Document - Copy (2).txt => null
Excluding path due to filter: C:\Temp2\Folder2\@@Test\New Text Document - Copy.txt => null
Excluding path due to filter: C:\Temp2\Folder2\@@Test\New Text Document.txt => null
Excluding path due to filter: C:\Temp2\Folder1\New Text @@ Document - Copy (4).txt => null
Excluding path due to filter: C:\Temp2\Folder1\New Text Document - Copy (2).txt => null
Excluding path due to filter: C:\Temp2\Folder1\New Text Document - Copy (3).txt => null
Excluding path due to filter: C:\Temp2\Folder1\New Text Document - Copy.txt => null
Excluding path due to filter: C:\Temp2\Folder1\New Text Document.txt => null
Matched 2 files (0 bytes)
Thanks a lot for your enlightening answer!
What I learned most is that Duplicati filters do not distinguish between files and folders - their names are just strings to them.