Restore via P5 CLI (example)
Posted by Andre Kuehnemund on 02 March 2015 11:39

Example of a restore in P5 using the CLI:

 

macmini:~ admin$ pwd

/Users/admin

macmini:~ admin$ cd /Users/admin/aw/bin

macmini:bin admin$ ./nsdchat -c RestoreSelection create localhost /Users/admin/Desktop/test

RestoreSelection.0

macmini:bin admin$ ./nsdchat -c RestoreSelection RestoreSelection.0 findentry 10001 {name == index.html}

6

macmini:bin admin$ ./nsdchat -c RestoreSelection RestoreSelection.0 findentry 10001 {name *= index}     

20

macmini:bin admin$ ./nsdchat -c RestoreSelection RestoreSelection.0 submit                              

12171

macmini:bin admin$ 

 

Please note:

The '6' in the above examples shows that 6 versions of that file were found in the archive index. Only the most recent version can be restored through the CLI at this time.

The '20' in the above example shows that 20 files starting with 'index' were found. Only the most recent version of each file can be restored through the CLI at this time.

The 12171 is the CLI job number.

 

(1 vote(s))
Helpful
Not helpful

Comments (2)
Will Luker
11 September 2017 23:33
what if I needed to restore a specific index.html file and not every single file that happens to be called "index.html"?

the command
./nsdchat -c RestoreSelection RestoreSelection.0 findentry 10001 {name == /some/path/index.html}
always returns 0.
How can we specify the full path of the files we want to restore?
thanks
Andre Kuehnemund
08 December 2017 16:41
To restore a specific file, you would need to se the 'RestoreSelection <name> addentry <archiveentry> [<path>]' command. For that you would need the archive handle of that file. The handle can be obtained using the 'ArchiveEntry handle <client> <path> [<database>]'.
So, in essence, run the ArchiveEntry handle command, then use the handle with the RestoreSelection addentry command.
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).