31. amanda.confの設定(2/7)
• org “DailySet1”
– 設定名。ディレクトリ名と同じ名前にする。
• mailto “ginjiro@begi.net”
– 通知メールの送信先を指定する。
• dumpuser “amanda”
– バックアップユーザーを指定。変更しない
• netusage 100000Kbps
– バックアップ時の転送速度の指定。誰もいない夜間に
バックアップするので、帯域は適当に大きくとった。
org DailySet1
# your organization name for reports
mailto "ginjiro@begi.net
# space separated list of operators ..
dumpuser "amanda"
# the user to run dumps under
netusage 100000 Kbps
# maximum net bandwidth for Amanda, ...
32. amanda.confの設定(3/7)
• 月 金にフルバックアップする
• dumpcycle 0 weeks
– 1サイクルの期間の指定
• runspercycle 0 days
– 1サイクルあたりにバックアップを実行する回数の指定
• tapecycle 5tapes
– 1サイクルあたりに使用するテープの本数
dumpcycle 0 weeks
# the number of days in the normal ...
runspercycle 0 days # the number of amdump runs in dumpcycle..
tapecycle 5 tapes
# the number of tapes in rotation...
33. バックアップサイクル
• 差分バックアップも可能
– フル・差分の間隔はAmandaにお任せになる
– バックアップ量に応じて判断してくれる
• 1週間を1サイクルとして、1サイクル中4日
バックアップを取る
• テープはdumpcycle*runspercycle+1本必要
dumpcycle 1 weeks
# the number of days in the normal ...
runspercycle 4 days # the number of amdump runs in dumpcycle..
tapecycle 5 tapes
# the number of tapes in rotation...
34. amanda.confの設定(4/7)
• tapetype: テープドライブの種類
– 次のページでドライブの設定を探して
設定ファイルの最後の方に書き加える
http://wiki.zmanda.com/index.php/
Tapetype_definitions
• labelstr: テープの命名規則
– 正規表現が使用可能。
– DailySet1-01, DailySet1-02 ...のようになる。
tapetype HP-Ultrium-960
# what kind of tape it is ...
labelstr ^DailySet1-[0-9][0-9]*$"
# label constraint regex: ...
43. 設定の確認(実行例)
$ amcheck DailySet1
Amanda Tape Server Host Check
-----------------------------
Holding disk /dumps/amanda: 227924984 KB disk space available, that's
plenty
slot 1: read label `DailySet1-01', date `X'
NOTE: skipping tape-writable test
Tape DailySet1-01 label ok
Server check took 0.277 seconds
Amanda Backup Client Hosts Check
--------------------------------
Client check: 3 hosts checked in 0.051 seconds, 0 problems found
(brought to you by Amanda 2.5.0p2)
52. amrecoverによるリストア演習
• Webサーバーの端末からamrecoverを実行
# amrecover -s orange -t orange -C DailySet1
AMRECOVER Version 2.5.0p2. Contacting server on orange ...
220 orange AMANDA index server (2.5.0p2) ready.
200 Access OK
Setting restore date to today (2008-11-12)
200 Working date set to 2008-11-12.
Scanning /dumps/amanda...
200 Config set to DailySet1.
200 Dump host set to ginjiro.office.begi.net.
Trying disk / ...
Trying disk rootfs ...
Can't determine disk and mount point from $CWD '/root'
amrecover>
53. amrecoverによるリストア演習
• バックアップされているディスクを確認して
マウントする
amrecover> listdisk
← ディスクの確認
200- List of disk for host ginjiro.office.begi.net
201- /var/www/html
200 List of disk for host ginjiro.office.begi.net
amrecover> setdisk /var/www/html
← マウント
200 Disk set to /var/www/html.
amrecover> ls
← バックアップ中の/var/www/htmlの一覧を表示
2008-11-12 wiki/
2008-11-12 top.png
← リストアしたいファイル
(略)
2008-11-12 .
amrecover>
55. amrecoverによるリストア演習
• リストアの実行
amrecover> extract
Extracting files using tape drive null: on host orange.
The following tapes are needed: DailySet1-02
Restoring files into directory /var/www/html
Continue [?/Y/n]? Y
← /var/www/htmlに展開して良いですか
Extracting files using tape drive null: on host orange.
Load tape DailySet1-02 now
Continue [?/Y/n/s/t]? Y
← DailySet1-02 をセットしてYを入力
./top.png
← 展開された
amrecover>