Purge command: You must provide either filename fiters, or a list of paths to remove

I search for a method to remove some files from all backups and found the “purge” command. I tried to use the command as explained in these posts:

I created a batchfile with the following content:

SET DUPLICATICLI="C:\Program Files\Duplicati 2\Duplicati.CommandLine.exe"

%DUPLICATICLI% purge "file://E:\BackupLaptop\" ^
  "C:\Users\jrast\Pictures\TestCatalog\Cache" ^
  --dbpath="C:\Users\jrast\AppData\Roaming\Duplicati\BDWOZVBHJF.sqlite" ^

However, I only get this response:

You must provide either filename filters, or a list of paths to remove

What’s wrong with this command? I also tried the --include=... parameter, but the output is the same.

I’m using duplicati

Hello @jrast, welcome to the forum!

Can you try running it from the GUI? I know of at least one user who reported it working fine from there but NOT in the command line…

Try add \ to Cache or twice )

I tried it in the GUI, but it didn’t work. And because it’s cumbersome to enter the command in the GUI multiple times and try different possibilities I switched to the command line.

Adding a “” to the path does not help.

I’ll need to do some more testing but with my canary version I can’t seem to get anything to purge either - via GUI or CLI. :thinking:

I am trying to get this to work as well?
Could anyone of the developers maybe supply a complete, working syntax either for commandline or commandline gui how to remove files and or folders out of a existing backup. The documentation on purge is sparse, its not clear what options are needed, how the files have to be listed and so on and so on.

For an existing backup done from the GUI, a good way to start is Export as Command-line which should make a compatible-but-independent ready-to-run backup command, then edit syntax into what you want. Similar advice applies when using Commandline in the GUI, except there your option display is nicer and there’s no concern over getting the quoting right. And I think that’s what went wrong in the original post…

Windows treats backslashed double quotes specially, so I think that one turned into an embedded quote. Being still inside the opening double quote, the space was not a separator, so the whole second line was appended to the end of the first (thereby making it appear there was no list of paths to remove, per error).

The solution is to either double the backslash before the double quote, if you actually want a backslash, or remove it, if you don’t. Sometimes Duplicati does use a trailing slash (of the right type for your OS) to say you want to refer to a folder not a file, but I’m not seeing that as a requirement for the local folder URL and actually I’m seeing there that forward slashes should work, and would avoid the backslash quote problem.

I think this might be the relevant quoting handling, but you can see a similar-but-maybe-different style here. People who are used to fighting quoting on UNIX-like shells may sympathize even though it’s not the same.

The basic purge syntax seems right. I ran both the list of pathnames and the filter syntax as seen in Filters where its flexibility comes from the choice of wildcards such as * or by more complex regular expressions. You must provide either filename filters, or a list of paths to remove appears to be right. The find command also takes filters, and might be a good way to see what files the purge will be purging…

Exactly what other advanced options or storage options you need varies, so I suggest you export a backup. Many other commands (such as purge) have similar configuration needs to backup, so can share settings.