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.
| |
|
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
So, in essence, run the ArchiveEntry handle command, then use the handle with the RestoreSelection addentry command.
https://support.archiware.com/support/index.php?/Knowledgebase/Article/View/12/0/access-the-cli
Example...
Get the archive handle for file '/Users/admin/Desktop/zzlexx.dylib':
---------------------------
[root@freenas] /mnt/awpool/aw/bin# ./nsdchat -c ArchiveEntry handle localhost /Users/admin/Desktop/zzlexx.dylib
Default-Archive#L1VzZXJzL2FkbWluL0Rlc2t0b3AvenpsZXh4LmR5bGli
[root@freenas] /mnt/awpool/aw/bin#
---------------------------
Once you have the archive handle, you add it to the restore selection you created earlier (see example in this KB article):
---------------------------
sh-3.2# /usr/local/aw/bin/nsdchat -c RestoreSelection RestoreSelection.3 addentry Default-Archive#L1VzZXJzL2FkbWluL0Rlc2t0b3AvenpsZXh4LmR5bGli localhost:/Users/admin/Documents/
/Users/admin/Desktop/zzlexx.dylib
sh-3.2#
---------------------------
You submit the restore selection for execution and the file should be restored to the alternate restore path specified (localhost:/Users/admin/Documents/).