Help with filters file (I attached my file)

I’m testing a backup job of mbox files. Some of this mbox files doesn’t need to be backed up, for exemple: trash, “all mails”, etc. And also some folders doesn’t need, like “cache”.

So i set up a filters file inside the centralized preferences folder:

\preferences\"mbox rep id"\filters (without extension)

where I have lines like:

...
-All Mail                       (the mbox file)
-All Mail.msf                   (the respective index)
-Trash
-Trash.msf
-/Data/profile/cache2/**    (that have a lot of subfolders)
...

But I ran a list command and these files and folders are being backed up.

The filters syntax is incorrect?

The path in the filters is always relative to the repository, so -/Data/profile/cache2/** should be Data/profile/cache2/*. -All Mail will on exclude the file in the root of the repository, so if you want to exclude all subdirectories named All Mail the rule should be -*/All Mail/.

The path in the filters is always relative to the repository, so
-/Data/profile/cache2/** should be Data/profile/cache2/*.

Ok! I´ll try this.

so if you want to exclude all subdirectories named All Mail

I think I didn’t explain well, All Mail is a - big - mbox file, not a directory.

There are several All Mail files, one for each account, as well as several Trash files and so on.

I gave up the wildcard notation and adopted the “regular expression” …

So just to remember: I want to exclude some of the mbox files. They come “in pairs”: a “.msf” file (the index) and a file with the same name and without extension (the mbox file). And these “pairs” appears in several sub-folders (accounts sub-folders).

I also want to exclude the cache folder: D:\......\Data\profile\cache2\

I configured this filters file:

(lines starting with # exclude... were copied from the wiki page)

(lines starting with # ==== are my additions)

# =======================================================================

# =============== COMMOM FILES ===============

# exclude any cache files/directories with cache in the name (case insensitive)
e:(?i).*cache.*$

# ==== SAME ABOVE, FOR OTHER TYPES
e:(?i).*Thumbs.*$
e:(?i).*desktop.ini*$

# exclude temporary file names
e:.*/?~.*$

# exclude common file types (case insensitive)
e:(?i)\.(bak|mp4|mkv|o|obj|old|tmp)$

# ==== DROPBOX TEMP FILES, I'LL "JOIN" WITH THE OTHERS IN THE LINE ABOVE LATER 
e:(?i)\.(dropbox)$



#=============== MBOX "UNWANTED" FILES ===============
# remember: "pairs" in several sub-folders...

e:(?i).*Todos os e-mails.*$
e:(?i).*Todos os e-mails$
e:(?i).*All Mail.*$
e:(?i).*All Mail$
e:(?i).*Importante.*$
e:(?i).*Importante$
e:(?i).*Important.*$
e:(?i).*Important$
e:(?i).*Lixeira.*$
e:(?i).*Lixeira$
e:(?i).*Trash.*$
e:(?i).*Trash$


# ==== MBOX CACHE FOLDER AND ALL ITS FILES AND SUB-FOLDERS
e:Data/profile/cache2/


# include everything else
i:.*

# ==============================================================================

Well, it seems like the cache exclusion is working.

But the msf pair files are still being backed up…

I don’t see anything wrong. Can you run duplicacy -d backup -dry-run to see if there is any more information that can be helpful?

And:

There are 16 compiled regular expressions stored
Loaded 16 include/exclude pattern(s)
Pattern: e:(?i).*cache.*$
Pattern: e:(?i).*Thumbs.*$
Pattern: e:(?i).*desktop.ini*$
Pattern: e:.*/?~.*$
Pattern: e:(?i)\.(bak|mp4|mkv|o|obj|old|tmp|dropbox)$
Pattern: e:(?i)\.(dropbox)$
Pattern: e:(?i).*Todos os e-mails.*$
Pattern: e:(?i).*Todos os e-mails.$
Pattern: e:(?i).*All Mail.$
Pattern: e:(?i).*All Mail$
Pattern: e:(?i).*Importante.*$
Pattern: e:(?i).*Importante.$
Pattern: e:(?i).*Important.*$
Pattern: e:(?i).*Important.$
Pattern: e:Data/profile/cache2/
Pattern: i:.*

Never mind…

Comparing the output file of the -d command above with my today log I found that only the “trash” files were backed up, and it is the only one that was left out of the filters archive, as you can see.

And I just had checked the “trash” files … Murphy’s law…

Thank you, Gilbert.

The filter file now looks like this (in the mbox files part):

e:(?i).*Todos os e-mails.*$
e:(?i).*Todos os e-mails$
e:(?i).*All Mail.*$
e:(?i).*All Mail$
e:(?i).*Importante.*$
e:(?i).*Importante$
e:(?i).*Important.*$
e:(?i).*Important$
e:(?i).*Lixeira.*$
e:(?i).*Lixeira$
e:(?i).*Trash.*$
e:(?i).*Trash$