Filter Rules ...

Get help for specific problems
Posts: 104
Joined: 14 Feb 2015

volker01

First: i mirror two folderpairs. All is fine.

Then, i decide a file (or a folder) not to sync and take it to the Filter.
The file or the folder still exist in the Destination.
Is this behavior desired?

volker01
User avatar
Posts: 2978
Joined: 22 Aug 2012

Plerry

I suppose "take it to the Filter" means you have added that item to the Exclude filter.
If so, what you describe is the designed-in behavior:
after all you have excluded that item from the sync,
so it will not be affected (in casu: deleted) by the sync.

Whether you find this the desired behavior is up to you ...
Posts: 104
Joined: 14 Feb 2015

volker01

Yes, to the Exclude Filter ...
Do not mirror this file next Mirroring ...
But should this file, then it is in the Exclude Filter - and exist in the destinatation - after next Mirroring - deleted in the Destination?
User avatar
Posts: 2978
Joined: 22 Aug 2012

Plerry

No because, as stated in my earlier reply:
"you have {now} excluded that item from the sync,
so it will not be affected (in casu: deleted) by the {next} sync."
Similarly (and fortunately ...), items not included per the Include filter are not part of the sync, and will not be affected by the sync.

In a Mirror sync, if you do want a Destination item to be deleted after the corresponding Source item has been deleted, do not add such item to the Exclude filter, or remove it from the Include filter.
Posts: 104
Joined: 14 Feb 2015

volker01

Sure but,
i don't won't delete this file in the source.
The goal is mirror files and folders to the destination.
Later i decide some file from the source should not mirrored to the destination,
then ffs should delete this file also in the destination, that is mirroring.

We have three variants in freefilesync:
Two way, Mirror and Update (and custom) ...

When a user won't delete exisiting files in the destination,
then he should use the variant: "update".
Posts: 1
Joined: 5 Apr 2018

KronusGT

I agree with volker01. After lots of filter tweaking over the last few years I just recently realized my backups are full of garbage that I had filtered out. When using Mirror I expected those files/folders to be removed. Now my only choices (because manually removing those files isn't an option) are to backup from scratch or write a tool that removes those files... unless that functionality is corrected/added to FreeFileSync.
Posts: 104
Joined: 14 Feb 2015

volker01

@KronusGT:
The only useful way is: take an new ffs-task, mirror with an empty folder to your destination - (clean the destination),
then run your normal mirror task with your current filter.
This solves not the problem for the future, it's only a workarround.
hope that this will be changed... the filter should only work to the source and not to the destination.
Posts: 104
Joined: 14 Feb 2015

volker01

Now i have a situation, where it is useful! that the filter doesn't have an effect to the Destination directory:

On a computer (with NT6.0) i have to split ffs into more than on tasks, because ffs runs on NT6.0 only in 32bit Mode and cannot mirroring all at once.
For that the ffs-config is:

ffs-task1: mirror only folder1 (source-dest.)
d:\userdir\folder1
s:\userdir\folder1

ffs-task2 mirror only folder2
d:\userdir\folder2
s:\userdir\folder2

ffs-task3: mirror all - WITHOUT the dir folder1 and folder2 (is in the filter)
d:\userdir
s:\userdir

In this case - when the filter would not works to the dest. - ffs would delete folder1 and folder2,
and that would be wrong here.
Posts: 4
Joined: 31 Jan 2026

switch

Heyhey,
I am making use of a bash-script for a while now to workaround this and recently I came around to polish and release it: https://github.com/Switch123456789/Bash-Scripts

It automatically creates a modified ffs_gui-file that is set up to delete the affected (excluded) files. Simply launch the script with the absolute path to your ffs_gui-file as parameter and FFS will launch, ready to compare and/or sync folders. It's made to work on Linux but bash for Windows exists, so maybe it can work on Windows if modified accordingly. ¯\_(ツ)_/¯

Hope someone can make use of it.
Posts: 4908
Joined: 11 Jun 2019

xCSxXenon

maybe it can work on Windows if modified accordingly. ¯\_(ツ)_/¯ switch, 02 Feb 2026, 15:29
Working on refactoring it into a batch script. Will report back when finished and it will be on my GitHub.
Should be done tomorrow
Posts: 4908
Joined: 11 Jun 2019

xCSxXenon

It is done. Main link with the README and info for "Delete Excluded Data.bat": https://github.com/xCSxXenon/batch_files
Direct link: https://github.com/xCSxXenon/batch_files/blob/main/Delete%20Excluded%20Data.bat

Usage details:
Usage: Delete Excluded Data.bat <path>
           Where <path> is the full path to your FFS configuration file.
           Supports .ffs_gui/.ffs_batch configurations.
           .ffs_batch configurations will be ===RAN AUTOMATICALLY===
           .ffs_GUI configurations will be opened in the GUI.
With its current implementation, you could run this as a post-sync command for your .ffs_batch configs to achieve 100% mirrors seamlessly!
User avatar
Posts: 2978
Joined: 22 Aug 2012

Plerry

@switch and @xCSxXenon
Do these two scripts also delete destination-side items that are excluded per the Time Span or Min/Max File size function?
See e.g. viewtopic.php?t=11477
User avatar
Posts: 2978
Joined: 22 Aug 2012

Plerry

A similar question as just above:
Do these two scripts (only) delete all destination-side items that match any entry in the Exclude list
or do they also delete all destination-side items that do not match any entry in the Include list?
Posts: 4
Joined: 31 Jan 2026

switch

On the Github-page of my script it is explained in detail what it does. It does NOT delete anything. It creates a modified copy of your config and opens it in FFS. In this copy, all your exclusions are set as inclusions and compared against an empty folder. The result is that FFS would want to delete all files/folders on the right site, that are marked as exclusions in your og config.

It doesn't care about timestamps or size, it will target ALL files/folders that pattern-match your exclude-list. If you wanna know what gets deleted, in FFS click "compare" before "sync", just as you would do with a normal pair-config.

I did it that way to make sure patterns are always interpreted by FFS (not my script) and so you can easily see what will be deleted. The Windows-version by @xCSxXenon might work differently, I didn't check that. But he said it's based on my work, so... I guess it works similar.
Posts: 4908
Joined: 11 Jun 2019

xCSxXenon

@switch and @xCSxXenon
Do these two scripts also delete destination-side items that are excluded per the Time Span or Min/Max File size function?
See e.g. viewtopic.php?t=11477 Plerry, 10 Jun 2026, 08:35
Mine also does NOT. There is no "Inclusion" option for those two filters, so there is not a way to swap them. And if there is a way, I did not implement it.

A similar question as just above:
Do these two scripts (only) delete all destination-side items that match any entry in the Exclude list
or do they also delete all destination-side items that do not match any entry in the Include list? Plerry, 10 Jun 2026, 10:07
The Include list in my implementation copies what the original Exclude filter contains. I do not place a '*' in there, or anything else on my own accord, so it should only delete anything that matches the original Exclude filter.
The way to "delete all destination-side items that do not match any entry in the Include list" would be to instead swap the Include filters to the Exclude, which is the reverse of my implementation. Since the overwhelming majority of people seem to be adding an item to the Exclude filter rather than removing it from the Include filter, I don't think the end result would be any different. Now, If someone were to remove an item from their Include filter, two scenarios:
1) Their Exclude filter was empty and now the Include filter is empty, so the script doesn't work, but nothing bad should happen either.
2) Their Exclude filter does have items and those are the only items that will be in the new Include filter, so it will miss the item that was removed from the Include filter.

There may be more pitfalls, or I may be wrong, but that's all my brain can think of currently. I can also almost guarantee that I would never implement any changes to account for those cases, since the user-base of the script is already tiny and those it would affect are assumed to be zero.