Restoring Solaris files with NetWorker 7.x
Using the NetWorker recover utility we can restore files on a Solaris system (or any other UNIX/Linux system) using the command line.
For the benefit of this article, we with use a Solaris NetWorker client (schlumpf) and restore the file /var/adm/messages.
Procedure
- On the NetWorker backup server, start the
recover
command specifying -c <client> for the given client. In our example:# recover -c schlumpf
NOTE: At the NetWorker recover prompt (recover>), you can use the ? command at anytime for help on any of the recover sub-commands. - Use the
chagetime
comand to set the date required for the restore. The date syntax is mm/dd/yyyy. For example:recover> changetime 02/23/2009
- Now we can walk the directory tree to where the original file was located. For example:
recover> cd /var/adm
- Using the
ls
command we can now perform a listing of the current directory. Or in case we will simply confirm that the file we wish to restore by specificing the complete path on thels
command. For example:recover> ls /var/adm/messages
- If the file(s) are availble for recovery, we can add them to our recovery list. For example:
recover> add /var/adm/messages
- Verify the required volumes are available for the restore. For example:
recover> volumes Volumes needed (all near-line): MBC019 at L180
NOTE: If the required media is not available in the Library you will need to insert the tape into the library and perform an inventory of the media to allow NetWorker use of this media:# nsrjb -a -T <volume> # nsrjb -I -S slot#
- Using the
list
we can conform which file(s) are marked for restore. For example:recover> list /var/adm/messages
- If you want to change the destination for your recovered files, use the
relocate
sub-command. For example:recover> relocate new destination directory: /var/tmp
or all on the command line. For example:recover> relocate /var/tmp
NOTE: If you do not userelocate
, then file(s) will be recovered to their original location. - Validate the recovery destination using the
destination
. For exmaple:recover> destination recover into /var/tmp
- Begin the recovery
recover> recover