I need a sample command line -- Issues running duplicati.commandline.exe on Windows

As simple as it may sound, I’m having problems trying to use duplicati.commandline.exe.
Even duplicati.commandline.exe --help test fails with the error:

C:\Program Files\Duplicati 2>Duplicati.CommandLine --help test
Found 0 commands but expected 1, commands:



C:\Program Files\Duplicati 2>

Trying the test command on its own is not working at all. Perhaps I’m not using the correct syntax… Here’s what I tried:

C:\Program Files\Duplicati 2>Duplicati.CommandLine --test ssh://host.domain.tld:22/mnt/backup/hi-entropy-hi-retention?auth-username=xxx&auth-password=xxx&ssh-fingerprint=ssh-rsa%202048%2084%3AB3%3AA7%3AE8%3A88%3AAD%3AF7%3A51%3A01%3AC0%3AFD%3A61%3A8B%3A05%3A73%3A03 all

Command not supported: ssh://host.domain.tld:22/mnt/backup/hi-entropy
-hi-retention?auth-username=xxx
'auth-password' is not recognized as an internal or external command,
operable program or batch file.
'ssh-fingerprint' is not recognized as an internal or external command,
operable program or batch file.

and with quotes around the arguments:

C:\Program Files\Duplicati 2>Duplicati.CommandLine --test "ssh://host.domain.tld:22/mnt/backup/hi-entropy-hi-retention?auth-username=xxx&auth-password=xxx&ssh-fingerprint=ssh-rsa%202048%2084%3AB3%3AA7%3AE8%3A88%3AAD%3AF7%3A51%3A01%3AC0%3AFD%3A61%3A8B%3A05%3A73%3A03" "all"

Command not supported:ssh://host.domain.tld:22/mnt/backup/hi-entropy-hi-retention?auth-username=xxx&auth-password=xxx&ssh-fingerprint=ssh-rsa%202048%2084%3AB3%3AA7%3AE8%3A88%3AAD%3AF7%3A51%3A01%3AC0%3AFD%3A61%3A8B%3A05%3A73%3A03

Trying to improvise a bit, I tried using --url and --samples, and all I got was the generic help:

C:\Program Files\Duplicati 2>Duplicati.CommandLine --test --url="ssh://host.domain.tld:22/mnt/backup/hi-entropy-hi-retention?auth-username=xxx&auth-password=xxx&ssh-fingerprint=ssh-rsa%202048%2084%3AB3%3AA7%3AE8%3A88%3AAD%3AF7%3A51%3A01%3AC0%3AFD%3A61%3A8B%3A05%3A73%3A03" --samples="all"

See duplicati.commandline.exe help <topic> for more information.
  General: example, changelog
  Commands: backup, find, restore, delete, compact, test, compare, purge,
  vacuum
  Reparing: repair, affected, list-broken-files, purge-broken-files
  Debugging: debug, logging, create-report, test-filters, system-info,
  send-mail
  Targets: aftp, amzcd, azure, b2, box, cloudfiles, dropbox, file, ftp,
  googledrive, gcs, hubic, jottacloud, mega, msgroup, onedrive, onedrivev2,
  sharepoint, openstack, rclone, s3, od4b, mssp, sia, ssh, tahoe, webdav
  Modules: aes, gpg, zip, 7z, console-password-input, mssql-options,
  hyperv-options, http-options, sendhttp, sendmail, runscript, sendxmpp,
  check-mono-ssl
  Formats: date, time, size, encryption, compression
  Advanced: mail, advanced, returncodes, filter, filter-groups, <option>

http://www.duplicati.com/              Version:  - 2.0.3.5_canary_2018-04-13

Running the Test command from the GUI also fails, when given one parameter (all) in addition to the URL:

Backup started at 2019-03-22 22:03:55

System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
   at System.Console.ReadKey(Boolean intercept)
   at Duplicati.Library.Modules.Builtin.ConsolePasswordInput.ReadPassphraseFromConsole(Boolean confirm)
   at Duplicati.Library.Modules.Builtin.ConsolePasswordInput.Configure(IDictionary`2 commandlineOptions)
   at Duplicati.Library.Main.Controller.SetupCommonOptions(ISetCommonOptions result, String[]& paths, IFilter& filter)
   at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action`1 method)
   at Duplicati.Library.Main.Controller.Backup(String[] inputsources, IFilter filter)
   at Duplicati.CommandLine.Commands.Backup(TextWriter outwriter, Action`1 setup, List`1 args, Dictionary`2 options, IFilter filter)
   at Duplicati.CommandLine.Program.RunCommandLine(TextWriter outwriter, TextWriter errwriter, Action`1 setup, String[] args)
Return code: 100

Any help to get this to work is appreciated…

Duplicati.CommandLine.exe expects a command, sometimes a storage URL and one or more advanced options.

Valid commands are HELP, BACKUP, RESTORE, FIND, COMPARE, TEST, COMPACT, DELETE, PURGE, REPAIR, AFFECTED, LIST-BROKEN-FILES, PURGE-BROKEN-FILES, CREATE-REPORT, TEST-FILTERS, SYSTEM-INFO and SEND-MAIL. Commands must be supplied without leading double dashes (test, not --test).

If you supply a URL, enter it without leading dashes.

Advanced options must be supplied with dashes.
Some valid commands:

Duplicati.CommandLine.exe backup "file://C:\BackupDir" "C:\SourceDir1\\" --backup-name="My Backup" --dblock-size=100mb --passphrase=MyPassword

Duplicati.CommandLine.exe find "file://C:\BackupDir" "*find-this*" --passphrase=MyPassword

Thank you, that was very helpful :slight_smile: