How to restore a single folder via CLI?

Welcome to the forums StefanBrand.

Yes, if you’re running MacOS or Linux then using duplicati-cli is shorter to type than mono Duplicati.CommandLine.exe but otherwise they are the exact same.

If you ran

  • duplicati-cli restore ftp://me:example.com@ftp.example.com/target "/source/myfile.txt" --overwrite

Your computer would actually run

  • mono Duplicati.CommandLine.exe restore ftp://me:example.com@ftp.example.com/target "/source/myfile.txt" --overwrite

Either or works.

It should probably go without saying but duplicati-cli does not exist in Windows, in the case of Windows omit the mono prefix and change the / to \, so it would be.

  • Duplicati.CommandLine.exe restore ftp://me:example.com@ftp.example.com/target "\source\myfile.txt" --overwrite

As a test I just renamed a folder on my desktop called usb to usbStick, this folder contains multiple files and folders. I then ran the following (yes, I’m in Windows and the backups are stored in local drive D:).

  • C:\Program Files\Duplicati 2>Duplicati.CommandLine.exe restore “D:\YourCompanyBackups” “C:\Users\Jimbo\Desktop\usb\*” Note the * as the last character (a wildcard as mentioned by ts678).

About 9 minutes later the usb folder and all of it’s contents have been recreated on my desktop as expected.

Side note, I need to look into this further but it seems if your backups are unencrypted you still need to provide a passphrase, doesn’t matter what gets typed in but something has to be typed. Possibly just using the --passphrase option with a blank value may prevent it but I haven’t had a chance to test it yet.

Enter encryption passphrase:
ErrorID: EmptyPassphrase
Empty passphrases are not allowed

If I type anything in for the Enter encryption passphrase: it accepts it and performs the restore.

Hopefully this helps get people working with the CLI, oh and one last thing, a quick reminder that CLI operations are not shown or recorded in the GUI.

3 Likes