Complex filter rule with exception not working

Get help for specific problems
User avatar
Posts: 2
Joined: 11 Sep 2023

buritto

I've gone through:
https://freefilesync.org/manual.php?topic=exclude-files

It says:
Exclude a sub folder except for *.txt files by using two folder pairs:
C:\Source <—> D:\Target     local exclude filter: \SubFolder\
C:\Source <—> D:\Target     local include filter: \SubFolder\*.txt
I'm trying to mirror *only* the text files I've on my Desktop folder (excluding all subfolders):

Left side:
C:\Users\XYZ
to a location (which is empty), right side:
Y:\Backups\Sync\C\Users\XYZ
In the filter local settings, include filter has been set to:
\Desktop\*.txt
and exclude filter has been set to:
\Desktop\
But NO text files show up on the comparison (using file time & size) results.

Screenshots:

UI:
Image

Filter local settings:
Image
User avatar
Posts: 2946
Joined: 22 Aug 2012

Plerry

The FFS manual page you link to yourself states:
Files and folders are only considered for synchronization if they pass all filter rules: They have to match at least one entry in the include list and none of the entries in the exclude list ...
You have excluded \Desktop\ (and thus everything in it), so also all *.txt files in \Desktop\, so it is not strange you see no *.txt files to be synced.

Your post is confusing, because the Compare results picture you show, are not/can not be the Compare results when using the Include/Exclude rules as per the picture you show.

Your description is also confusing. Your picture shows TWO left-right folder pairs, but if you really are
"trying to mirror *only* the text files I've on my Desktop folder (excluding all subfolders):",
you can Include \Desktop\*.txt (which would include all *.txt files in \Desktop\ and its subdirectories), and then Exclude \Desktop\*\ (which excludes all subdirectories of \Desktop\).

But because of your conflicting pictures, and inconsistency between your description and any of your pictures, your exact intentions are not clear.
User avatar
Posts: 4866
Joined: 11 Jun 2019

xCSxXenon

The link to the manual is stating you need to use two folder pairs, each with the same left and right locations. The first pair will locally exclude the directory and the second pair will locally include the txt files
User avatar
Posts: 2
Joined: 11 Sep 2023

buritto

Thanks so much for the replies.
you can Include \Desktop\*.txt (which would include all *.txt files in \Desktop\ and its subdirectories), and then Exclude \Desktop\*\ (which excludes all subdirectories of \Desktop\). Plerry, 11 Sep 2023, 08:23
Exclude \Desktop\*\ solved the issue. Thank you.