You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a special scenario where Duplicati fails to include by path when filter used as regexp: --include="[/mnt/user/share/]"
and when identical used as non-regexp, it works: --include="[/mnt/user/share/]"
I've included a zip with the data dir and two commands, one which fails, and one which works
It only seems to happen if a following exclude will exclude parent-folders of the source dir. However the first two filters ensures the include from the top of the source, and also there shouldn't be a difference between regexp and non-regexp as long as they both match. In other words I got configuration to work as I wanted by avoiding exclude [/.*/] and instead exclude from my source dir [/mnt/user/share/.*/]. I'm not certain whether this is coincidental or not.
The second and third filter above should both have included user/share folder
Output from error variant, should have included /mnt/user/media/TestDuplicati/user/share/
$ ./testDuplicati-bad.sh
Including source path: /mnt/user/media/TestDuplicati/
Including path due to filter: /mnt/user/media/TestDuplicati/cache/ => ([((/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/)|(/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/share/))|(/mnt/user/media/TestDuplicati/user/share/)])
Including path due to filter: /mnt/user/media/TestDuplicati/user/ => ([((/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/)|(/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/share/))|(/mnt/user/media/TestDuplicati/user/share/)])
Excluding path due to filter: /mnt/user/media/TestDuplicati/user/otherShare/ => ([/.*/])
Excluding path due to filter: /mnt/user/media/TestDuplicati/user/share/ => ([/.*/])
Excluding path due to filter: /mnt/user/media/TestDuplicati/cache/share/ => ([/.*/])
Matched 0 files (0 bytes)
Success full Command
Note the only difference is removal of [] brackets around 3. filter. Same result if we remove the second (regexp) filter below..
Output from success variant, which correctly includes /mnt/user/media/TestDuplicati/user/share/
$ ./testDuplicati-good-non-regexp-include.sh
Including source path: /mnt/user/media/TestDuplicati/
Including path due to filter: /mnt/user/media/TestDuplicati/cache/ => ([(/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/)|(/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/share/)]) || (/mnt/user/media/TestDuplicati/user/share/)
Including path due to filter: /mnt/user/media/TestDuplicati/user/ => ([(/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/)|(/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/share/)]) || (/mnt/user/media/TestDuplicati/user/share/)
Excluding path due to filter: /mnt/user/media/TestDuplicati/user/otherShare/ => ([/.*/])
Including path due to filter: /mnt/user/media/TestDuplicati/user/share/ => ([(/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/)|(/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/share/)]) || (/mnt/user/media/TestDuplicati/user/share/)
Including path due to filter: /mnt/user/media/TestDuplicati/user/share/user.log => ([/.*])
Excluding path due to filter: /mnt/user/media/TestDuplicati/cache/share/ => ([/.*/])
Matched 1 files (674 bytes)
PS: It would be nice if test-filters had an option to not list all included files but just number of files in each dir (or something).
The problem is that the regexp expressions are combined into (((/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/)|(/mnt/user/media/TestDuplicati/(cache|disk\d+|user)/share/))|(/mnt/user/media/TestDuplicati/user/share/)).
This matches the first part of the path: /mnt/user/media/TestDuplicati/user/ share/
Because it is tested if the match is the full length, this will fail to match the path.
A workaround is to put start ^ and end $ markers around each of the individual regexp strings..
To fix this in the code, we need to always wrap regexp filters in these markers.
Jojo-1000
added a commit
to Jojo-1000/duplicati
that referenced
this issue
Oct 12, 2023
Environment info
Description
I found a special scenario where Duplicati fails to include by path when filter used as regexp:
--include="[/mnt/user/share/]"
and when identical used as non-regexp, it works:
--include="[/mnt/user/share/]"
I've included a zip with the data dir and two commands, one which fails, and one which works
It only seems to happen if a following exclude will exclude parent-folders of the source dir. However the first two filters ensures the include from the top of the source, and also there shouldn't be a difference between regexp and non-regexp as long as they both match. In other words I got configuration to work as I wanted by avoiding exclude [/.*/] and instead exclude from my source dir
[/mnt/user/share/.*/]
. I'm not certain whether this is coincidental or not.Error-Command
The second and third filter above should both have included user/share folder
Output from error variant, should have included
/mnt/user/media/TestDuplicati/user/share/
Success full Command
Note the only difference is removal of [] brackets around 3. filter. Same result if we remove the second (regexp) filter below..
Output from success variant, which correctly includes
/mnt/user/media/TestDuplicati/user/share/
PS: It would be nice if test-filters had an option to not list all included files but just number of files in each dir (or something).
TestDuplicati-support.zip
system-info.txt
The text was updated successfully, but these errors were encountered: