红旗linux mysql_恢复 - 红旗Linux案例精选:Amanda集中备份实例详细讲解_数据库技术_Linux公社-Linux系统门户网站...
五、恢復
假定我們需要恢復cp3上一些丟失的數據,首先用amandabackup帳號登錄cp2機器,創建/etc/amanda/amanda-client.conf文件,內容如下:
#
# amanda.conf - sample Amanda client configuration file.
#
# This file normally goes in /etc/amanda/amanda-client.conf.
#
conf "FileBackup"# your config name
index_server "cp1.domain.com"# your amindexd server
tape_server "cp1.domain.com"# your amidxtaped server
#tapedev "tape:/dev/YOUR-TAPE-DEVICE-HERE"# your tape device
# if not set, Use configure or ask server.
# if set to empty string "", ask server
# amrecover will use the changer if set to the value
# of 'amrecover_changer' in the server amanda.conf.
# auth- authentication scheme to use between server and client.
# Valid values are "bsd", "bsdudp", "bsdtcp", "krb5", "local",
# "rsh" and "ssh".
# Default: [auth "bsdtcp"]
auth "bsdtcp"
#ssh_keys ""# your ssh keys file if you use ssh auth
然后使用root帳號運行amrecover命令來初始化data恢復過程
[root@cp3 ~]# amrecover
AMRECOVER Version 2.6.1p1. Contacting server on cp1.domain.com ...
220 cp1 AMANDA index server (2.6.1p1) ready.
Setting restore date to today (2009-04-13)
200 Working date set to 2009-04-13.
200 Config set to FileBackup.
200 Dump host set to cp3.domain.com.
Use the setdisk command to choose dump disk to recover
amrecover>
接下的一些命令演示如何將特定的一些數據恢復到指定的目錄(這里指定/tmp)
amrecover> listdisk
200- List of disk for host cp3.domain.com
201- /opt/www/sites
200 List of disk for host cp3.domain.com
amrecover> setdisk /opt/www/sites
200 Disk set to /opt/www/sites.
amrecover> ls
2009-04-13-17-49-11 newltf/
2009-04-13-17-49-11 lawburn/
2009-04-13-17-49-11 hnnoritz/
2009-04-13-17-49-11 fireyang/
2009-04-13-17-49-11 admin/
2009-04-13-17-49-11 .htpasswd
2009-04-13-17-49-11 .
amrecover> cd admin
/opt/www/sites/admin
amrecover> ls
2009-04-13-17-49-11 var
2009-04-13-17-49-11 usr
2009-04-13-17-49-11 tmp
2009-04-13-17-49-11 sbin
2009-04-13-17-49-11 lib
2009-04-13-17-49-11 etc
2009-04-13-17-49-11 dev
2009-04-13-17-49-11 bin
2009-04-13-17-49-11 domain.com/
2009-04-13-17-49-11 .
amrecover> cd domain.com
/opt/www/sites/admin/domain.com
amrecover> ls
2009-04-13-17-49-11 var
2009-04-13-17-49-11 usr
2009-04-13-17-49-11 tmp
2009-04-13-17-49-11 subdomains/
2009-04-13-17-49-11 sbin
2009-04-13-17-49-11 mysql/
2009-04-13-17-49-11 lib
2009-04-13-17-49-11 etc
2009-04-13-17-49-11 dev
2009-04-13-17-49-11 bin
2009-04-13-17-49-11 Mailboxs/
2009-04-13-17-49-11 .
amrecover> add subdomains/
Added dir /admin/domain.com/subdomains/ at date 2009-04-13-17-49-11
amrecover> lcd /tmp
amrecover> extract
Extracting files using tape drive changer on host cp1.domain.com.
The following tapes are needed: FileBackup-06
Restoring files into directory /tmp
Continue [?/Y/n]? y
Extracting files using tape drive changer on host cp1.domain.com.
Load tape FileBackup-06 now
Continue [?/Y/n/s/d]? y
./admin/domain.com/subdomains/
./admin/domain.com/subdomains/404/
./admin/domain.com/subdomains/404/bin/
./admin/domain.com/subdomains/404/cgi-bin/
./admin/domain.com/subdomains/404/dev/
./admin/domain.com/subdomains/404/etc/
./admin/domain.com/subdomains/404/html/
./admin/domain.com/subdomains/404/lib/
./admin/domain.com/subdomains/404/libexec/
./admin/domain.com/subdomains/404/logs/
./admin/domain.com/subdomains/404/logs/2009/
./admin/domain.com/subdomains/404/logs/2009/04/
./admin/domain.com/subdomains/404/sbin/
./admin/domain.com/subdomains/404/tmp/
......
我們看看/tmp下面是不是已經有了我們剛才恢復的數據:
[root@cp3 ~]# tree /tmp/admin/domain.com/subdomains/ |more
/tmp/admin/domain.com/subdomains/
|-- 404
| |-- bin
| | |-- bash
| | |-- cat
| | |-- echo
| | |-- false
| | |-- gunzip
| | |-- ls
| | |-- mkdir
| | |-- mv
| | |-- pwd
| | |-- rm
| | |-- scp
| | |-- sftp
| | |-- sh
| | |-- tar
| | |-- unzip
| | `-- zip
| |-- cgi-bin
| |-- dev
| | |-- null
| | |-- random
| | `-- urandom
......
Ok,到此為止,Amanda備份配置基本完成,當然我們很多的配置都是基于缺省定義,比如槽位數,備份周期等,更多詳細的定義,可以參考/usr/lib/amanda/example/amanda.conf文件。
總結
以上是生活随笔為你收集整理的红旗linux mysql_恢复 - 红旗Linux案例精选:Amanda集中备份实例详细讲解_数据库技术_Linux公社-Linux系统门户网站...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在mysql中删除表中字段_MySQL中
- 下一篇: mysql 深胡_Mysql胡说八道