I'm trying to use the Duplicati API to restore a single file.
About the Scenario: The whole thing runs on linux so it is compiled with mono. My backup contains two source Folders, so if I run Interface.ListSourceFolders()
I get an Array of two.
Desired result: I want to restore one single file (or Folder) from my backup
Current result: If I run the code below it restores all the backed up files (so Folder 1 and Folder 2) into the path in //Comment1
.
List<string> files = new List<string>();
files.Add("path"); //Comment1
Dictionary<string,string> options = new Dictionary<string,string>();
options["passphrase"] = MySettings.Password;
options["restore-time"] = date;
//Comment2
Interface i = new Interface("file:///path/to/archives", options);
string result = i.Restore(files.ToArray());
What I tried: I tried to set the path at //Comment1
to the absolute path (/desired/file/to/restore
) or using the index of the source Folder (0/file/to/restore
) and I also played around at //Comment2
. e.g. I added something like options["restore-path"] = "/path/to/restore"
. I always get the same result.
Does anyone see what I'm doing wrong? Because I don't know what else I could try. There is almost no documentation so I don't know where to search. If someone knows a link for a good documentation I would be happy too!