Topics: Backup & restore, EMC, EMC Networker

EMC/Legato Networker: Performing recoveries from command Line

To perform recoveries from EMC (or Legato) Networker on the command line, you can use the 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: 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.

# recover /etc 
Current working directory is /etc
recover>
Note: If you do not get a recover prompted when you type recover, add a -s servername option:
# recover -s hostname
The following commands let you navigate a client file index to select and recover files and directories:
  • 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 content of that directory is displayed.
  • cd
    Changes the current working 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, 2009 or 12/15/2009.
  • 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 -a option. For example:

Recover the /etc/hosts file from the most recent backup:
# recover -a /etc/hosts
Using the recover Command in Directed Recoveries:

To relocate recovered files use the -d destination option with the recover command:
# 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 `networker'
Recover completion time: Thu Nov 18 14:39:15 2009
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, and 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.
# recover 
Current working directory is /
recover> versions /etc/hosts

Versions of `/etc/hosts':

   4 -rw-rw-r-- root     system       2006 Mar 31 16:32 hosts
     save time:  Mon Aug  9 20:02:53 EDT 2010
      location:  004049

   4 -rw-rw-r-- root     system       2006 Mar 31 16:32 hosts
     save time:  Fri Aug  6 21:11:07 EDT 2010
      location:  DD0073 at DDVTL

   4 -rw-rw-r-- root     system       2006 Mar 31 16:32 hosts
     save time:  Mon Aug  2 20:06:48 EDT 2010
      location:  004242 at rd=ntwrkrstgnd1:ATL

   4 -rw-rw-r-- root     system       2006 Mar 31 16:32 hosts
     save time:  Fri Jul 30 21:09:15 EDT 2010
      location:  DD0054 at DDVTL

   4 -rw-rw-r-- root     system       2006 Mar 31 16:32 hosts
     save time:  Mon Jul 26 20:10:20 EDT 2010
      location:  004095

recover> changetime 8/1/2010
6497:recover: time changed to Sun Aug  1 23:59:59 EDT 2010
recover> add /etc/hosts
/etc
1 file(s) marked for recovery
recover> recover
Recovering 1 file into its original location
Volumes needed (all on-line):
        DD0054 at \\.\Tape20
Total estimated disk space needed for recover is 4 KB.
Requesting 1 file(s), this may take a while...
./hosts
./hosts file exists, overwrite (n, y, N, Y) or rename (r, R) [n]? y
Overwriting ./hosts
Received 1 file(s) from NSR server `networker'
Recover completion time: Thu Aug 12 17:34:06 EDT 2010
Using the -f option we can recover files from the command line without having to answer questions if we want to overwrite any existing files. For example, if you wish to recover the entire /etc file system into /tmp:
# recover -f -d /tmp/ -a /etc/
All the files will be recovered to /tmp/etc.

The -c option can be used to recover files from different client. For example, if you wish to recover the entire /etc file system of server "otherclient" to /tmp:
# recover -f -c otherclient -d /tmp/ -a /etc/
The -t option can be used to do a point-in-time recover of a file and/or file system. For example, to recover the /etc/hosts file of 09/05/2010 at noon:
# recover -s networkerserver -t "09/05/2010 12:00" -a /etc/hosts
Recovering multiple files is also possible. For example, if you wish to recover 2 mksysb images:
# recover -f -c client -s server -a mksysb.image1 mksysb.image2




If you found this useful, here's more on the same topic(s) in our blog:


UNIX Health Check delivers software to scan Linux and AIX systems for potential issues. Run our software on your system, and receive a report in just a few minutes. UNIX Health Check is an automated check list. It will report on perfomance, capacity, stability and security issues. It will alert on configurations that can be improved per best practices, or items that should be improved per audit guidelines. A report will be generated in the format you wish, and the report includes the issues discovered and information on how to solve the issues as well.

Interested in learning more?