Duplicacy CLI cannot send login credentials properly

I want to try/use Duplicacy CLI for cloud storage backup via FTP.
According to the Duplicacy quick tutorial, the proper login command formatting should look like this: ftp://user@192.168.0.1/path/to/storage

But this causes a problem for me, because the login name to my cloud storage account is the e-mail address I used when I registered the account long ago. This login name is the same regardless of what protocol I use, SFTP, Webdav etc. There is no way to change this circumstance.

This means that my login command ends up looking like this, with two ā€˜@ā€™ in the parameters:
ftp://email_address@mailserver.com@ftp.cloudstorage.com/path/to/storage

Needless to say, this doesnā€™t work.

Iā€™m looking for suggestions to alternatives to this login method, workarounds or ā€¦ perhaps Iā€™m missing something that doesnā€™t appear to me at this time.

Thx in advance for any input

Welcome to the forum Franz!

It is strange that the provider use this, because this username format does not match the RFC1738 standard:

<user> : <password> @ <host> : <port> / <url-path>

Try with the @ character in your username encoded (%40):

ftp://email_address%40mailserver.com@ftp.cloudstorage.com/path/to/storage

Hi, Towerbr. Thank you for the welcome.

Yes, I must agree. I havenā€™t seen many login names like this - other than through web forms. But the cloudstorage provider is a big and wellknown one, so this is not because Iā€™m using some small obscure and strangely set service.

I will try your suggestion once I get home, and report back.

Duplicacy doesnā€™t supports FTP. For SFTP I think you can have 2 @'s in the storage url. Anything before the second @ will be taken as the user name.

Good pointā€¦ SFTPā€¦ I didnā€™t notice this ā€œdetailā€ā€¦ :roll_eyes:

Youā€™re right!. Me writing FTP is wrong. I shouldā€™ve written Webdav, thatā€™s what I used.
I use the same client for both FTP, SFTP and Webdav so it seems I caught on to the wrong word there. Sorry 'bout that.

Ok, this was interesting. I tried using %40 instead of @, like this:

duplicacy init mytest1 webdav://user.name%40mailserver.com@dav.fileserver.com/dav/backuptest

ā€¦ and in return I got ā€œruntime error: slice bounds out of rangeā€. Followed by the these descriptions in the prompt:

goroutine 1 [running]:
runtime/debug.Stack(0x29, 0x0, 0x0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0xae
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x29
github.com/gilbertchen/duplicacy/src.CatchLogException()
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/src/duplicacy_log.go:183 +0x190
panic(0xc72560, 0x12d0970)
        /usr/local/go/src/runtime/panic.go:502 +0x237
github.com/gilbertchen/duplicacy/src.CreateStorage(0xd8d091, 0x7, 0xc04208a080, 0x6, 0x0, 0x0, 0xc0420b0080, 0x35, 0x0, 0x0, ...)
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/src/duplicacy_storage.go:630 +0x47ae
main.configRepository(0xc0421c6ea0, 0xc0421c6e01)
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/duplicacy/duplicacy_main.go:317 +0x5e6
main.initRepository(0xc0421c6ea0)
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/duplicacy/duplicacy_main.go:212 +0x37
github.com/gilbertchen/duplicacy/vendor/github.com/gilbertchen/cli.Command.Run(0xd8a583, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0xdbee5b, 0x4f, 0x0, ...)
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/vendor/github.com/gilbertchen/cli/command.go:160 +0x7f1
github.com/gilbertchen/duplicacy/vendor/github.com/gilbertchen/cli.(*App).Run(0xc0421c6c60, 0xc042086080, 0x4, 0x4, 0x0, 0x0)
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/vendor/github.com/gilbertchen/cli/app.go:179 +0x86b
main.main()
        /Users/chgang/zincbox/go/src/github.com/gilbertchen/duplicacy/duplicacy/duplicacy_main.go:1996 +0x5853

ā€¦ not sure what to make of this. Seems like the program wasnā€™t expecting the %40 and donā€™t know what to do with it?

The webdav backend will gladly take a username with a @. No need to replace it with %40. But of course %40 should not cause it to crash. Iā€™ll fix this bug.

1 Like

Oh, seems I contributed to something annoyingly healthy (?) :slight_smile:

Right, Webdav seems to work anyway, as long as one includes the password after a colon between username and password.

Iā€™ll take the opportunity to continue asking one thing about the coding. I know things about scripting, batches and simple programming, but the help of starting with Duplicacy CLI still feels like going over the deep end to me.

Since itā€™s an EXE for Windows, Iā€™m assuming I should interact with this program via the common Win10 command prompt, yet most youtube videos about it demonstrates using telnet (?).

The first help about Duplicacy that I read, says ā€œOnce you have duplicacy in your pathā€ ā€¦ I donā€™t know what this means (?). Using the command prompt, how do I ā€˜get duplicacy in my pathā€™? It doesnā€™t feel like it means moving into the directory where the executable is located, because the example code in the help is: $ cd path/to/your/repository, and the next line of code utilizes the duplicacy.exe in the current folder: $ duplicacy init mywork sftp://user@192.168.1.100/path/to/storage.

First, the $ doesnā€™t work with the code in the command prompt, and this code seems to suggest I should relocate to the disk which I wish to backup? But that is not where the duplicacy.exe is located. Or, does it imply that duplicacy.exe ā€˜shouldā€™ be located there? If I want to backup 4 different disks, then perhaps duplicacy.exe needs to be found in the root dir of each partition? Oh, I just remembered, this refers to SFTP/SSH via Telnet, not the command prompt? Oh, well ā€¦

Well, what if I first try and interpret the code example as literary as I can. Initially I am positioned in the folder c:\duplicacy, so what if I use the DOS command ā€œCD path/to/your/repositoryā€, in my case ā€œCD d:ā€ ā€¦ Well, then Iā€™m still in the same folder. I need to manually go over to the D disc, to be in that directory. And once I am, I need to use a rework to access the duplicacy.exe.

So the first initial commands, like ā€œduplicacy init d: mytest1ā€ gives me this return:
ā€œFailed to create the directory c:\duplicacy/ .duplicacy: mkdir c:\duplicacy.duplicacy: The system cannot find the file specifiedā€

This is confusing to me. I guess Iā€™m asking for a more accessible introduction on how to implement the commands and principles of the CLI version, because I have big problems figuring out how to do what. Once Iā€™m off and running on the right software client, I can probably manage pretty quickly.

Since you want to use :d: cli, why not add duplicacy to any folder you like (eg. C:/all/PortableApplications/duplicacy.exe), and just run all commands with that path:

cd c:/the/path/to/the/repository

"C:/all/PortableApplications/duplicacy.exe" init
"C:/all/PortableApplications/duplicacy.exe" -d backup
"C:/all/PortableApplications/duplicacy.exe" -log -d list
etc.

Also, if you have very few repositories, you could just copy the exe file directly into the repo, and use it like duplicacy.exe backup etc.

Also, for scripting i like better powershell, as the commands make more sense and you also have autocomplete and global history.

Lastly, if you want to have a no headache cli usage, you could try my own scripts: Scripts and utilities index (open this link in a new tab)

Ooh, it turns out the storage service Iā€™m using, and trying to get to work with Duplicacy, only offers Webdav as secure connection (https type). There was no ā€˜Sā€™ in the adress (only in the https), so I didnā€™t catch it at first. I suspect Duplicacy CLI isnā€™t prepared for secure protocol handshakes - yet(?)

That must be why my Webdav attempts keeps failing. Have to see what other protocols I can use then ā€¦