mono - C# Duplicati Interface restore single file -
i'm trying use duplicati api restore single file.
about scenario: whole thing runs on linux compiled mono. backup contains 2 source folders, if run interface.listsourcefolders()
array of two.
desired result: want restore 1 single file (or folder) backup
current result: if run code below restores backed files (so folder 1 , folder 2) 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 = new interface("file:///path/to/archives", options); string result = i.restore(files.toarray());
what tried: tried set path @ //comment1
absolute path (/desired/file/to/restore
) or using index of source folder (0/file/to/restore
) , played around @ //comment2
. e.g. added options["restore-path"] = "/path/to/restore"
. same result.
does see i'm doing wrong? because don't know else try. there no documentation don't know search. if knows link documentation happy too!
in case if interested. after trying around hours found out how restore single file or folder. here i'm doing now:
list<string> files = new list<string>(); files.add("/restore/path"); //comment1 dictionary<string,string> options = new dictionary<string,string>(); options["passphrase"] = mysettings.password; options["restore-time"] = date; options["file-to-restore"] = "files"; //comment2 interface = new interface("file:///path/to/archives", options); string result = i.restore(files.toarray());
at //comment1
need set desired restore path. in folder backup-set-folders created (the folders interface.listsourcefolders()
)
at //comment2
can specify files restored in form: 0/file/to/restore
0
index of source folder (interface.listsourcefolders()
). if need restore multiple files can combining them 1 string: e.g. windows: 0/file1;1/file2
or linux 0/file1:1/file2
(the difference semicolon or colon)
now there 1 more thing: can not restore folder files. need combine files , sub-files in string mentioned above.
i hope somebody.
Comments
Post a Comment