Bug in job export

I’ve created a password for my FTP which includes symbol $. When I export job configuration it has “Pa%24%240rd” instead “Pa$$w0rd”.

Example:
“C:\Program Files\Duplicati 2\Duplicati.CommandLine.exe” backup “ftp://localhost//?auth-username=ftpuser&auth-password=Pa%24%24w0rd” “C:\FTPRoot\New folder\” --backup-name=FTP --dbpath=“C:\Users\Administrator\AppData\Local\Duplicati\WMHEYJUINV.sqlite” --encryption-module= --compression-module=zip --dblock-size=50mb --no-encryption=true --disable-module=console-password-input

I don’t think this is a bug. Many characters, not just $, will be escaped when it converts to this URL format. Duplicati will un-escape them as needed to restore original values as they were entered.

This example is from GUI when you want to export backup configuration, not from URL.

By “URL” i meant how Duplicati stores the target information, including the username and password. It’s in URL (URI) format: ftp://localhost//

I don’t think this encoding/escaping actually causes a problem because it is undone by Duplicati automatically as needed. Are you actually experiencing a problem due to this or did you just note it because it looked wrong?

I don’t have any issue because I’ve noticed an issue :), it’s a test environment.

My point of view is that if Duplicate provides an option like “export backup configuration” then it should generate correct data. Idea was to copy code which Duplicati GUI generated in a browser and paste it into a BAT file. Because it does not contain the correct password when I ran the BAT file backup wasn’t successful. This is how I noticed an issue with a password and this is the main reason why I report this as a bug.

Ok good to know it did not work as-is when you used it in a batch file. I think it should have so I agree it looks like a bug. I will try to reproduce it…

The BACKUP command

Duplicati.CommandLine.exe backup <storage-URL> "<source-path>" [<options>]

Exporting a backup job configuration

As Command-line
If you don’t want to use the Graphical User Interface to manage your backups and/or you want to use another task scheduler instead of the scheduler that is integrated in Duplicati, you can use the Command-line export to generate a command that you can use to perform the current backup job with the Duplicati.CommandLine.exe tool.

Works fine here, therefore I’ll claim it generated correct data. The unfortunate thing about .bat files is that it seems more aggressive about percent interpretation. In bat files, the percent escapes itself, so
Pa%%24%%24w0rd works there – and doesn’t work as a command-line (which is its documented goal).

Anybody who’s more expert in .bat files than I am might have a different solution to getting universal.

Good catch. Percents do need to be doubled up in batch files. This is with cmd but not necessarily other command parsers like poweshell. In that case I think duplicati is working correctly.

I had to look that up. I don’t claim to be .bat expert, but FTP is is clear text (beware). Network traffic:

220-FileZilla Server 0.9.60 beta
220-written by Tim Kosse (tim.kosse@filezilla-project.org)
220 Please visit https://filezilla-project.org/
USER duplicati
331 Password required for duplicati
PASS Pa44w0rd
530 Login or password incorrect!

I wondered if %24 became 4, so started researching percent interpretation (still weakly understood…).

EDIT:

Command-line arguments makes me think %2 asks for the second command-line paramter passed in.
And now I remember the shift workaround for going past 9. I’m glad I don’t do much batch currently.
UNIX has its own set of character escape-or-interpret pains, but at least I fought them later and more.