No luck excluding folders when restoring from the web UI

I have searched in the forum and I’ve seen there is a bunch of non clear explanations on how to use
exclusion/inclusion when restoring.

I need to restore with the web UI one revision of BackupID “Omen_Homes” from the storage “Box2-BackupIvan” (url sftp://ivan@my.backups.server/the/backups) excluding any .git folder.
I have tried with the web UI without luck and the ‘Options’ using ‘-.git/’, ‘-.git/’, '-.git/’.
All tries show the error ‘Invalid options were passed to the restore command’

Can someone who understands the include/exclude system write some examples?
That would be very useful for anyone else in this situation in the future too.

Would be great to have some examples with the full CLI command line to:
restore including some folders and some files
restore excluding some folders and some files

Thank you very much in advance!!

That’s because the - in your pattern is interpreted as a beginning of another command line option. .git is not a valid option of course, and that’s what it tells you. And it’s right.

From restore · gilbertchen/duplicacy Wiki · GitHub :

Unlike the backup procedure that reading the include/exclude patterns from a file, the restore procedure reads them from the command line. If the patterns can cause confusion to the command line argument parser, -- should be prepended to the patterns. Please refer to the Include/Exclude Patterns section for how to specify patterns.

This is a very common: once you are done providing options to a program, you provide -- to indicate that there are not going to be any more options, thereby preventing it from trying to interpret following arguments as options.

I don’t remember, does duplicacy-web invite the user to provide restore options or separately options and separately filters? In the latter case it should have handled this on its own.

I did not understand tha – thing.

I had to add “-- -* -.git/ +/the/folder/i/need/” to ensure only that folder is included but exclude at the same time the .git repo folder.

Thank you @saspus for your clarification!

Meh, no. tried all combinations and I continue doing something wrong because it does not works at all.

I need to extract from a backup the /home/ivan/repos/this_and_only_this_repo at the time I exclude all .git folders below that folder. none of the attempts worked properly
– -* -/.git/ +repos/deployInstances/Infraestructura/
– -* -/.git/ +repos/deployInstances/Infraestructura/

The repos/deployInstances/Infraestructura/k8s/.git and any other .git below that root is still there…
What I am doing wrong with the options?

Maybe like this::


duplicacy’s regex engine does not support look-aheads so there is not much you can do. I’d just restore the whole folder and then delete what you did not need.

In this specific usecase you probably would want to use git to rollback your files, not duplicacy.