1. Knowledge Base
  2. Restore Operations

How to Use the amrecover Command to Restore Data?

This article explains the steps to restore data using the Amrecover tool.

Steps to Restore Data From Command Line Using the Amrecover Tool:

Amrecover is a Zmanda utility which is built into all Zmanda servers and clients. This utility can be used to restore data from the command line terminal. There is a sequence of steps that can be run inside the amrecover prompt to recover the data.

The steps are as follows:

To enter the amrecover prompt, simply run the below command as the root user. In case of Solaris clients you will have to provide the absolute path to the binary:

/opt/zmanda/amanda/amanda/sbin/amrecover
  1. amrecover backupset_name
    This will take you inside the amrecover prompt.
  2. amrecover >
    The next step is to select the date on which the backup was taken. This date should be entered in the yyyy-mm-dd format. If you want to specify the time, use yyyy-mm-dd-hh-mm-ss format.
  3. amrecover > setdate yyyy-mm-dd

    Use the listhost command to list the available hosts and sethost to select the host.

  4. amrecover > listhosts
  5. amrecover > sethost hostname/ip-address

    Use the listdisk command to list the DLEs and setdisk to select the DLE.

  6. amrecover > listdisk
  7. amrecover > setdisk dle_path

    Once the disk is selected, you can use ls and cd commands to navigate inside the selection.

    Once you have located the file or directory that you want to restore, simply add it by using

  8. amrecover > add file_name/directory_name

    If you want to add multiple files or directories, you will have to add them separately using the add command each time.

    If you want to restore the entire backup, then use add. after the 7th step. This will select the parent directory.

  9. amrecover > add .

    Next step is to select the destination directory where you want to restore to. It is always a better option to restore to a different directory to avoid overwriting your files.

    To select the destination directory, use the lcd command and to confirm this use the lpwd command.

  10. amrecover > lcd destination_directory
  11. amrecover > lpwd

    To start the restore, simply run extract.

  12. amrecover > extract

    Once you run extract, it will ask for final confirmation regarding the backup media and destination.

    Select Y, if the options are correct and it will proceed with the restore.

    To exit the amrecover prompt,use

  13. amrecover > exit

    You can also use the amrecover man pages to know more about this tool and to see the additional options that are available.

  14. man amrecover