Restore filter with spaces in path broken in webui

While trying to restore from a backup, was trying to exclude a directory. On adding
-- -"TV Series, Others"
(quotes included) this was parsed as 3 filters
-- -"TV Series,"
again 3 filters
-- -"TV Series"
2 filters
-- -"TV"
1 filter.

Running the same filter with the cli -- -"TV Series, Others" works perfectly with one filter detected and used, and the restore proceeding as expected.

Relevant log snippets
cli:

2021-06-02 20:17:55.580 INFO STORAGE_SET Storage set to gcd://duplicacy
2021-06-02 20:17:58.416 INFO SNAPSHOT_FILTER Loaded 2 include/exclude pattern(s)
2021-06-02 20:18:00.636 INFO RESTORE_INPLACE Forcing in-place mode with a non-default preference path
2021-06-02 20:18:07.016 INFO SNAPSHOT_FILTER Parsing filter file /cache/localhost/restore/.duplicacy/filters
2021-06-02 20:18:07.017 INFO SNAPSHOT_FILTER Loaded 0 include/exclude pattern(s)

webui:

2021/06/02 20:17:55 Running /home/duplicacy/.duplicacy-web/bin/duplicacy_linux_x64_2.7.2 [-log restore -r 52 -storage gcd -overwrite -stats -threads 16 -- -"TV Series"]
2021/06/02 20:17:55 Set current working directory to /cache/localhost/restore

Things I tried: double quotes, single quotes, backslashes to escape the space, not adding any quotes/backslashes.
Finally opened a shell inside the container, ran the same command posted by duplicacy web (after removing [ ]) and it’s running fine now.

Am I missing something obvious? Thanks.

1 Like

The web GUI always breaks down the arguments by spaces when passing them to the CLI. A workaround is to replace spaces with wildcards, such as -- -TV*Series*Others

Can this behavior be fixed please? When I’m using " in path after +/- I’m expecting it to preserve that bit as a raw command line argument, as the field name “options” suggests. If I’m using the same thing in shell the behavior is different.
a. Add this behavior of web ui not preserving spaces to the docs, i couldn’t find anything about that on the filter page, and the closest thing i found was Include/Exclude Patterns clarifications which suggests that spaces don’t matter. Of course now I know that they do matter and this is only for filter files.
b. Fix the parsing of command line options during restore, which does not apply arbitrary logic and treats it as shell argument.
c. Of course, none of this would be required if restore had a Include/Exclude picker in web ui like we have for backup.

Thanks.

1 Like

sorry for reviving an old thread but i just ran into this and i see it is still not resolved. Replacing spaces with wild cards is technically incorrect and not a true workaround since it can conceivably lead to undesired results (if there’s a similarly named subdirectories downstream).

i tried even including quotes but that doesn’t help.

also, i ran into this during backup, not during restore.
it simply refuses to include a path with spaces in it, no matter how i try to include it (quotes, backslashes, etc.)

1 Like

I’m not sure why does duplicacy even bothers to incorrectly replicate shell behavior here?

Python has shlex.split, there is no similar built in library in go; but it does not matter. Duplicacy shall not try to mess with shell arguments parsing in the first place.

It shall get what user types and pass it to shell as is. Let the shell do splitting.

Splitting by spaces is actively sabotaging using input. It’s quite an egregious issue.

Ideally, the restore workflow in duplicacy shall be completely overhauled, but until then — let’s not sabotage the user who paid for GUI but had to figure our command line options.