Include/Exclude Filtering question

I’m trying to follow the filter guide, but I have to admit that my eyes are starting to cross. Maybe I’m just getting old, but it seems far more complicated than any filtering mechanism I’ve ever come across.

I’m running Duplicacy-Web. I’m trying to ensure that I exclude two directory names. I want to exclude them everywhere, including any located in sub/sub/sub/directories of the backup root path. My current filters look like this:

-@eaDir/* 
-#recycle/*
-*#recycle/*
  1. Will these two directories be excluded EVERYWHERE?
  2. How would I also exclude a file extension (.exe) everywhere?
-@eaDir/
-#recycle/
-*/@eaDir/
-*/#recycle/

Note, * matches everything, including path separator. To match directories the rule must end with /. Otherwise it will match files.

First two will exclude these folders in the root, and the next two everywhere else

Alternatively, you can collapse everything into a single regex, something like this:

e:^(.*/)?(@eaDir|#recycle)/$
2 Likes

Thanks, So to exclude a file the same way, I would use:

-*.exe
-*/*.exe

Just the first one is enough – remember, * also matches /

So, following that logic, why isn’t this adequate for both root and sub-dirs?

-*.exe
-*@eaDir/
-*#recycle/

Also, since * matches /, why do I need it at all in this example. There’s no possibility of a file existing with the name #recycle or @eaDir, so why not just use:

-*@eaDir*
-*#recycle*

I’ve used regex and file/folder filtering for many years. For some reason, this particular flavor seems a bit picky and complex… At first, I though it was just me, but the sheer number of posts about the filtering seems to suggest otherwise. (sorry, whine concluded)

Because your version matches “/…/hello#recycleme” and /…/whatsup@eaDirhellow files you did not intend to exclude, whether you have them or not. Putting explicit path separator prevents that. But with the /prefix files in the backup root folder are not affected, so, you add them back explicitly.

And lastly, to exclude directory, the statement must end with /. Otherwise it will be matching files.

Filtering in duplicacy is not better or worse than other approaches, the only annoyance with it is that it requires you do be very verbose when including or excluding files and sub folders in the directory hierarchy. Everything else is pretty transparent, including your case.

Alright. Thanks again.