Saltar la navegación

Restaurar datos

La restauración de los datos se hace con el comando amrecover ejecutado como root en el equipo cliente. Veámoslo con un ejemplo, supongamos que queremos recuperar el fichero ~/Descargas/password.txt, sobre un directorio provisional (~/restore) que crearemos para la restauración, pues no queremos, en este momento, recuperarlo en su directorio original.

# mkdir restore
# cd restore/
# amrecover BackupUsuarios -s servidorbackup.asir.com
AMRECOVER Version 3.3.6. Contacting server on servidorbackup.asir.com ...
220 servidorbackup AMANDA index server (3.3.6) ready.
Setting restore date to today (2015-12-03)
200 Working date set to 2015-12-03.
200 Config set to BackupUsuarios.
501 Host pc01 is not in your disklist.
Trying host pc01.asir.com ...
200 Dump host set to pc01.asir.com.
Use the setdisk command to choose dump disk to recover
amrecover> listhost
200- List hosts for config BackupUsuarios
201- pc01.asir.com
201- pc02.asir.com
201- 127.0.0.1
200  List hosts for config BackupUsuarios
amrecover> sethost pc01.asir.com
200 Dump host set to pc01.asir.com.
amrecover> listdisk
200- List of disk for host pc01.asir.com
201- /home/usuario
200 List of disk for host pc01.asir.com
amrecover> setdisk /home/usuario
200 Disk set to /home/usuario.
amrecover> ls
2015-12-03-09-27-25 "Vídeos/"
2015-12-03-09-27-25 Plantillas/
2015-12-03-09-27-25 "Público/"
2015-12-03-09-27-25 "Música/"
2015-12-03-09-27-25 "Imágenes/"
2015-12-03-09-27-25 Escritorio/
2015-12-03-09-27-25 Documentos/
2015-12-03-09-27-25 Descargas/
2015-12-03-09-27-25 .xsession-errors.old
2015-12-03-09-27-25 .xsession-errors
2015-12-03-09-27-25 .vboxclient-seamless.pid
2015-12-03-09-27-25 .vboxclient-draganddrop.pid
2015-12-03-09-27-25 .vboxclient-display.pid
2015-12-03-09-27-25 .vboxclient-clipboard.pid
2015-12-03-09-27-25 .profile
2015-12-03-09-27-25 .mozilla/
2015-12-03-09-27-25 .local/
2015-12-03-09-27-25 .gksu.lock
2015-12-03-09-27-25 .gconf/
2015-12-03-09-27-25 .dmrc
2015-12-03-09-27-25 .dbus/
2015-12-03-09-27-25 .config/
2015-12-03-09-27-25 .cache/
2015-12-03-09-27-25 .bashrc
2015-12-03-09-27-25 .bash_logout
2015-12-03-09-27-25 .bash_history
2015-12-03-09-27-25 .Xauthority
2015-12-03-09-27-25 .ICEauthority
2015-12-03-09-27-25 .
amrecover> cd Descargas
/home/usuario/Descargas
amrecover> ls
2015-12-03-09-27-25 sublime-text_build-3083_amd64.deb
2015-12-03-09-27-25 password.txt
2015-12-03-09-27-25 .
amrecover> add pass*
Added file /Descargas/password.txt
amrecover> list
TAPE EtiquetaDisco04:2 LEVEL 0 DATE 2015-12-03-09-27-25
    /Descargas/password.txt
amrecover> setdevice file:/var/backups/amanda/BackupUsuarios/vtapes/disco04
Using tape "file:/var/backups/amanda/BackupUsuarios/vtapes/disco04".
Tape server unspecified, assumed to be servidorbackup.asir.com.
amrecover> extract

Extracting files using tape drive file:/var/backups/amanda/BackupUsuarios/vtapes/disco04 on host servidorbackup.asir.com.
The following tapes are needed: EtiquetaDisco04

Extracting files using tape drive file:/var/backups/amanda/BackupUsuarios/vtapes/disco04 on host servidorbackup.asir.com.
Load tape EtiquetaDisco04 now
Continue [?/Y/n/s/d]?
Restoring files into directory /home/usuario/restore
All existing files in /home/usuario/restore can be deleted
Continue [?/Y/n]?

./Descargas/password.txt
amrecover> exit
200 Good bye.
# tree
.
└── Descargas
    └── password.txt

1 directory, 1 file