Add option for restore command to pass filters file

Goal: I want to restore a repository, but there are already existing files which I want to keep. (Use case: I deleted some files, and want to restore them, not knowing which I deleted. Or: Fresh OS install and I want to pull all files I added later which are in the backup)

Currently not providing the -overwrite option fails if there are already existing files (it should rather just continue if there are any erros happening and just log the errors, see Adds -persist option to check and restore commands to continue despite errors by twlee79 · Pull Request #595 · gilbertchen/duplicacy · GitHub and Improving robustness of duplicacy to missing/corrupt chunks with a secondary snapshot table), in order to emulate the desired behaviour I wanted to provide all existing files in a filters list.

Unfortunately, this does not work because the restore command ignores the filters list. It writes “Loaded 0 include/exclude patterns” (those are the ones passed as arguments) and then a couple of lines below “Loaded 33943 include/exclude patterns”, but apparently it ignores those as it tries to download a file that exists and then fails.

1 Like

The restore command accepts patterns from the command line:

USAGE:
   duplicacy restore [command options] [--] [pattern] ...

For example, if you want to skip existing files you can do something like:

duplicacy restore -r reivsion -- -relative/path/to/existing/files
1 Like

@gchen That’s correct, but this Feature request is about adding an option to pass a filters file, because it’s not possible to pass 33943 patterns in the command (see explanation of details above).

1 Like

Isn’t this a duplicate of Restore: skip existing files instead of overwrite, which is also created by you, @dreamflasher?

Having the skip option would solve this request as well.

It’s not a duplicate – it would be an alternative solution, that would solve the same problem for me (but there are likely other other use-cases in which the two requests differ).