Exclude option not working


#1

I’m gonna make a new post, cuz posts I can find are older.

Basically, I exclude the Temp dir and it still gets included.

My command line as exported from the GUI. Specifically look at my excludes:

"C:\Program Files\Duplicati 2\Duplicati.CommandLine.exe" backup
"file://G:\duplicati_backup_storage\\"
"C:\Users\user2\\"
"C:\Users\user1\\"
--backup-name="user user1 and user2 all files"
--dbpath="C:\ProgramData\Duplicati\Data\80898885857587717782.sqlite"
--encryption-module=aes --compression-module=zip --dblock-size=50mb
--passphrase=mypassphrase --thread-priority=idle
--use-background-io-priority=true --snapshot-policy=On
--log-file="C:\path\job_log_file.log" --log-file-log-level=Verbose
--disable-module=console-password-input
--exclude="*/AppData/Local/Temp*"
--exclude="*/Google/Chrome/*cache*"
--exclude="*/Google/Chrome/Safe Browsing*"
--exclude="*/Mozilla/Firefox/*cache*"
--exclude="*/Temporary Internet Files/"
--exclude="*/Safari/Library/Caches/"

Specifically, let’s look at this exclude:

--exclude="*/AppData/Local/Temp*"

And now checking my logfile, I get Temp dir for both users:

2019-02-08 17:01:53 -05 - [Verbose-Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess-IncludingPath]: Including path as no filters matched: C:\Users\user1\AppData\Local\Temp\
2019-02-08 17:01:53 -05 - [Verbose-Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess-IncludingPath]: Including path as no filters matched: C:\Users\user1\AppData\Local\Temp\Low\
2019-02-08 17:01:53 -05 - [Verbose-Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess-IncludingPath]: Including path as no filters matched: C:\Users\user1\AppData\Local\Temp\scoped_dir2168_26689\
2019-02-08 17:01:53 -05 - [Verbose-Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess-IncludingPath]: Including path as no filters matched: C:\Users\user1\AppData\Local\Temp\scoped_dir4328_15648\

2019-02-08 17:04:06 -05 - [Verbose-Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess-IncludingPath]: Including path as no filters matched: C:\Users\user2\AppData\Local\Temp\
2019-02-08 17:04:08 -05 - [Verbose-Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess-IncludingPath]: Including path as no filters matched: C:\Users\user2\AppData\Local\Temp\1096_18517\
2019-02-08 17:04:08 -05 - [Verbose-Duplicati.Library.Main.Operation.Backup.FileEnumerationProcess-IncludingPath]: Including path as no filters matched: C:\Users\user2\AppData\Local\Temp\1096_4936\

Is it flat out broken?

Do I need to use backslashes in my excludes? double backslashes (ie escaped backslashes)?


#2

Since it looks like you’re running on Windows, yes - think you need backslashes:
https://duplicati.readthedocs.io/en/latest/appendix-d-filters/#using-filters

Also note that to match a folder you must end with the slash or backslash - otherwise I believe you’re just matching files.


#3

Ok given your hints, including the entire filters discussion in the manual, I tried using the GUI to “Exclude directories whose names contain” and I specified “temp”. Ie:

image

Selecting “Edit as text” (the 3 dots menu upper right) for that gives (note the BACKslash):

image

Then I exported command line and got (note, again, the BACKslash):

--exclude="*temp*\\"

So, I think you’ve hit the nail (both nails) on the head.

  1. Use backslash for windows
  2. To match dirs, must end with slash (backslash)

(BTW, quote from Manual - Filters - Syntax: “Folder names always end with a slash / on Linux or Mac and a backslash \ on Windows. For instance, log is a file, log/ is a folder.” So, yeah, that one sentence would have corrected both my mistakes. Read That Fine Manual indeed)

Thanks so much!


#4

Glad to hear you got it working!

I flagged your post as the solution. :slight_smile: