In order to restore files in place, you must invoke amrecover from the root of the backed up filesystem, or use lcd to move into that directory, otherwise a directory tree that resembles the backed up filesystem will be created in the current directory. See the examples below for details.
Amrecover will read the amanda-client.conf file and the config/amanda-client.conf file. If no configuration name is supplied on the command line, Amrecover will try the compiled-in default configuration ,usually DailySet1.
See the amanda(8) man page for more details about Amanda.
The Default values are those set at compile-time. Use amrestore to recover client-encrypted or client-custom-compressed tapes.
[ -C ] config
Amrecover connects to the index server and then presents a command line prompt. Usage is similar to an ftp client. The GNU readline library is used to provide command line history and editing if it was built in to amrecover.
The purpose of browsing the database is to build up a restore list of files to be extracted from the backup system. The following commands are available:
setdate YYYY-MM-DD-HH-MM[-SS] | YYYY-MM-DD
For example, if:
1996-07-01 was a level 0 backup 1996-07-02 through 1996-07-05 were level 1 backups 1996-07-06 through 1997-07-08 were level 2 backups
then the command setdate 1997-07-08-00 would yield files from the following days:
1997-07-08 (the latest level 2 backup) 1997-07-05 (the latest level 1 backup) 1997-07-01 (the latest level 0 backup)
Only the most recent version of a file will be presented.
The following abbreviated date specifications are accepted:
setdisk diskname [mountpoint]
setproperty [append] [priority] name [value ...]
setdevice [[-h tape-server] tapedev]
If you want amrecover to use your changer, the tapedev must be equal to the amrecover-changer setting on the server.
Since device names contain colons, you must always specify the hostname.
settape 192.168.0.10:file:/file1You can change the tape device when amrecover ask you to load the tape:
Load tape DMP014 now Continue? [Y/n/t]: t Tape device: server2:/dev/nst2 Continue? [Y/n/t]: Y Using tape /dev/nst2 from server server2.
add item1 item2 ...
addx item1 item2 ...
delete item1 item2 ...
deletex item1 item2 ...
The following shows the recovery of an old syslog file.
# cd /var/log # ls -l syslog.7 syslog.7: No such file or directory # amrecover MyConfig AMRECOVER Version 2.4.2. Contacting server on oops ... 220 oops Amanda index server (2.4.2) ready. Setting restore date to today (1997-12-09) 200 Working date set to 1997-12-09. 200 Config set to MyConfig. 200 Dump host set to this-host.some.org. $CWD '/var/log' is on disk '/var' mounted at '/var'. 200 Disk set to /var. /var/log WARNING: not on root of selected filesystem, check man-page! amrecover> ls 1997-12-09 daemon.log 1997-12-09 syslog 1997-12-08 authlog 1997-12-08 sysidconfig.log 1997-12-08 syslog.0 1997-12-08 syslog.1 1997-12-08 syslog.2 1997-12-08 syslog.3 1997-12-08 syslog.4 1997-12-08 syslog.5 1997-12-08 syslog.6 1997-12-08 syslog.7 amrecover> add syslog.7 Added /log/syslog.7 amrecover> lpwd /var/log amrecover> lcd .. /var amrecover> extract Extracting files using tape drive /dev/nst0 on host 192.168.0.10 The following tapes are needed: DMP014 Restoring files into directory /var Continue? [Y/n]: y Load tape DMP014 now Continue? [Y/n/t]: y set owner/mode for '.'? [yn] n amrecover> quit 200 Good bye. # ls -l syslog.7 total 26 -rw-r--r-- 1 root other 12678 Oct 14 16:36 syslog.7
If you do not want to overwrite existing files, create a subdirectory to run amrecover from and then move the restored files afterward.
# cd /var # (umask 077 ; mkdir .restore) # cd .restore # amrecover AMRECOVER Version 2.4.2. Contacting server on oops ... ... amrecover> cd log /var/log amrecover> ls ... amrecover> add syslog.7 Added /log/syslog.7 amrecover> lpwd /var/.restore amrecover> extract Extracting files using tape drive /dev/nst0 on host 192.168.0.10 ... amrecover> quit 200 Good bye. # mv -i log/syslog.7 ../log/syslog.7-restored # cd .. # rm -fr .restore
If you need to run amrestore by hand instead of letting amrecover control it, use the list command after browsing to display the needed tapes.
# cd /var/log # amrecover AMRECOVER Version 2.4.2. Contacting server on oops ... ... amrecover> ls ... amrecover> add syslog syslog.6 syslog.7 Added /log/syslog Added /log/syslog.6 Added /log/syslog.7 amrecover> list TAPE DMP014 LEVEL 0 DATE 1997-12-08 /log/syslog.7 /log/syslog.6 TAPE DMP015 LEVEL 1 DATE 1997-12-09 /log/syslog amrecover> quit
The history command shows each tape that has a backup of the current disk along with the date of the backup, the level, the tape label and the file position on the tape. All active tapes are listed, not just back to the most recent full dump.
Tape file position zero is a label. The first backup image is in file position one.
# cd /var/log # amrecover AMRECOVER Version 2.4.2. Contacting server on oops ... ... amrecover> history 200- Dump history for config "MyConfig" host "this-host.some.org" disk "/var" 201- 1997-12-09 1 DMP015 9 201- 1997-12-08 1 DMP014 11 201- 1997-12-07 0 DMP013 22 201- 1997-12-06 1 DMP012 16 201- 1997-12-05 1 DMP011 9 201- 1997-12-04 0 DMP010 11 201- 1997-12-03 1 DMP009 7 201- 1997-12-02 1 DMP008 7 201- 1997-12-01 1 DMP007 9 201- 1997-11-30 1 DMP006 6 ... amrecover> quit
PAGER The ls and list commands will use $PAGER to display the file lists. Defaults to more if PAGER is not set.
AMANDA_SERVER If set, $AMANDA_SERVER will be used as index-server. The value will take precedence over the compiled default, but will be overridden by the -s switch.
AMANDA_TAPE_SERVER If set, $AMANDA_TAPE_SERVER will be used as tape-server. The value will take precedence over the compiled default, but will be overridden by the -t switch.
amanda(8), amanda-client.conf(5), amrestore(8), amfetchdump(8), readline(3)
The Amanda Wiki: : http://wiki.zmanda.com/
Alan M. McIvor <firstname.lastname@example.org>
Stefan G. Weichinger <email@example.com>