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

#1

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" ^
  --dry-run

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 2.0.3.5_canary_2018-04-13

#2

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…

#3

Try add \ to Cache or twice )

#4

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.

#5

Adding a “” to the path does not help.

#6

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

#7

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.

#8

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.