Performing Recoveries from Command Line
Networker recover command
The recover command runs in two modes:
- Interactive mode � Interactive mode is the default mode for the recover command. This mode places you in a shell-like environment that allows you to use subcommands. These commands let you navigate the client file index to select and recover files and directories.
- Non-interactive mode (-a option) � In non-interactive mode, the files specified on the command line are recovered automatically without browsing. To activate non-interactive mode, use the �a option.
Using recover in Interactive Mode:
Login to the server you need to recover the file for and then type recover. This will place you in the recover shell environment. You can also type recover [pathname] to set your initial working directory (recover /etc), the default is the current working directory.
[root@legatounixmst /]$recover
recover: Current working directory is /
recover>
[root@legatounixmst /]$recover /etc
recover: Current working directory is /etc/
recover>
*Note: If you do not get a recover prompted when you type recover, add a �s servername option.
[root@legatounixmst /]$recover -s legatounixmst.itd.bnl.gov
The following commands let you navigate and client file index to select and recover files and directories.
Option | Description |
ls | Lists information about the given files and directories. When no name argument is provided, ls lists the contents of the current directory. When you specify a directory as name, the directory�s contents are displayed. |
cd | Changes the current working directory to directory. The default is the directory in which you executed recover. |
pwd | Prints the full pathname of the current working directory. |
add [name.. ] | Adds the current directory or the named files or directories to the recover list. If a directory is specified, it is added with all of the subordinate files to the recover list. |
delete [name..] | Deletes the current directory or the named files or directories from the recover list. If a directory is specified, that directory and all of the subordinate files are deleted from the recover list. |
versions [name..] | List all available versions for a file or directory. If no name is given the current working directory is used. |
changetime | Change the backup browse time to recover files before the last backup. You will be prompted for new time. Time can be entered as December 15, 2004 or 12/15/2004. |
list | Displays the files on the recover list. |
recover | Recovers all files on the recover list from the Networker server. Upon completion, the recover list is empty. |
exit | Exits immediately from the recovery |
quit | Exits immediately from the recover. Files on the recover list are not recovered. |
Using recover in Non-interactive mode:
In non-interactive mode, the files specified on the command line are recovered automatically without browsing. To activate non-interactive mode, use the option.
Examples:
Recover the /etc/hosts file from the most recent backup
recover > /etc/hosts
Using the recover Command in Directed Recoveries:
To relocate recovered files use the �d destination option with the recover command.
Examples:
To direct recovered files to /restore directory in interactive mode
recover -d /restore
To direct the recovery of /etc/hosts file to /restore directory in non-interactive mode
recover -a -d /restore /etc/hosts
[root@legatounixmst /]$recover -a -d /restore /etc/hosts
Recovering 1 file from /etc/ into /restore
Requesting 1 file(s), this may take a while...
./hosts
Received 1 file(s) from NSR server `legatounixmst.itd.bnl.gov'
Recover completion time: Thu Nov 18 14:39:15 2004
Using the recover Command to recover a file from a specific date:
Enter the recover shell by typing recover.
Locate the file you need to restore using the ls and cd commands.
List the versions for the file using the versions command,
Use the changetime command to change to the day the file was backed up
Add the file to the recovery list using the add command.
[root@legatounixmst /]$recover
recover: Current working directory is /
recover> versions /etc
Versions of `/etc/':
4 drwxr-xr-x root sys 4096 Jan 13 17:48 etc/
save time: Thu Jan 13 18:10:27 2005
location: ACW057S2 at PX720
4 drwxr-xr-x root sys 4096 Jan 12 17:48 etc/
save time: Wed Jan 12 18:07:05 2005
location: ACW059S2 at PX720
4 drwxr-xr-x root sys 4096 Jan 11 17:48 etc/
save time: Tue Jan 11 18:09:28 2005
location: ACW062S2 at PX720
4 drwxr-xr-x root sys 4096 Jan 10 19:48 etc/
save time: Mon Jan 10 20:18:09 2005
location: ACW062S2 at PX720
recover> changetime 1/9/2005
time changed to Sun Jan 9 23:59:59 2005
recover> add /etc
recover> recover
Courtesy: http://quark.phy.bnl.gov
No comments:
Post a Comment
Hi, Leave a comment here and one of the binary piper's will reply soon :)