> For the complete documentation index, see [llms.txt](https://docs.zmanda.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zmanda.com/amanda-community/getting-started-with-amanda/recovering-files.md).

# Recovering Files

## Configuration

We'll be using amrecover(8) to recover files from backup. Before we can recover files, a little more configuration is in order. Amrecover is technically a client tool, and contacts the server to "pull" the recovery down to the client. You'll recall this is the reverse of the backup situation, where the server contacts the client to ask for its data. As such, we'll need to configure the client to talk to the server. Put the following in /etc/amanda/amanda-client.conf:

```
index_server "localhost"
tapedev "changer"
auth "local"
```

There, that wasn't so bad.

## Start the Recovery

Amrecover will recover into subdirectories of the current directory. It's good form to run amrecover in an empty directory, so (as root):

```
mkdir /tmp/test-recovery
cd /tmp/test-recovery
```

amrecover runs as root, since it's restoring files and permissions - something a non-root user can't do. It's time to start amrecover:

```
knuth ~ # amrecover MyConfig
Using index server from environment AMANDA_SERVER (knuth)
AMRECOVER Version 3.2.1. Contacting server on knuth ...
220 knuth AMANDA index server (3.2.1) ready.
Setting restore date to today (2011-01-01)
200 Working date set to 2011-01-01.
200 Config set to MyConfig.
501 Host knuth is not in your disklist.
Use the sethost command to choose a host to recover
amrecover> 
```

Amrecover tries to be useful and guess the hostname you want to restore. We used "localhost" instead of "knuth", so this guess didn't work out. That's OK, though! You just need to tell amrecover what host to use.

```
amrecover> sethost localhost
200 Dump host set to localhost.
```

and let's narrow in and recover the latest backup of 'groups':

```
amrecover> setdisk /etc
200 Disk set to /etc.
amrecover> add group
Added file /group
```

and extract the file

```
amrecover> extract
Extracting files using tape drive changer on host knuth.
The following tapes are needed: MyData01
Extracting files using tape drive changer on host knuth.
Load tape MyData01 now
Continue [?/Y/n/s/d]? Y
Restoring files into directory /root
All existing files in /root can be deleted
Continue [?/Y/n]? Y
./group
```

Hit control-d to exit amrecover, and there's your file:

```
knuth ~ # find .
.
./group
```

That's nice and easy, isn't it?

Although amrecover was designed for use by users, most Amanda admins only run amrecover on the Amanda server, and then transfer the recovered files into place using some other mechanism like scp or rsync.

## For More Info

Have a look at [How To:Recover Data](https://wiki.zmanda.com/index.php/How_To:Recover_Data) for the basic guide to amrecover.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zmanda.com/amanda-community/getting-started-with-amanda/recovering-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
