PostgreSQLスキルアップノート(自己啓発のための個人サイト)
番外編・Amanda3.1・バックアップ実行
【一覧に戻る】
ごく簡単に確認した程度です。
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
■■■■
■■■■ Amanda 3.1 検証
■■■■
■◆■■ 番外編・Amanda3.1・バックアップ実行
■■■■
■■■■ 2012/03
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
アマンダにはコミュニティ版の他、有償のエンタープライズ版がある。
■■公式サイト
アマンダプロジェクト
http://www.amanda.org/
■■参考資料関連参考
ドキュメント
http://wiki.zmanda.com/index.php/Main_Page
日本語参考(ただし個人ページ、バージョンが異なっている)
http://virtualtech.jp/download/090130AmandaBackup.pdf
http://www.turbolinux.com/products/server/10s/manual/user_guide/user_guide/x12055.html
http://www.oss-d.net/amanda/2.5#mc3c497d
■■実行前チェック(/usr/sbin/amdumpコマンド)
【□】 amcheck DailySet1
問題があるときはERRORと表示される。
NOTEのメッセージは問題ないはず。
-------------------------------------------------------
-bash-3.2$ amcheck DailySet1
Amanda Tape Server Host Check
-----------------------------
found in slot 1: volume 'DailySet1-01'
slot 1: volume 'DailySet1-01'
Will write to volume 'DailySet1-01' in slot 1.
NOTE: skipping tape-writable test
NOTE: conf info dir /etc/amanda/DailySet1/curinfo does not exist★
NOTE: it will be created on the next run.
NOTE: index dir /etc/amanda/DailySet1/index does not exist
NOTE: it will be created on the next run.
Server check took 0.748 seconds
Amanda Backup Client Hosts Check
--------------------------------
Client check: 1 host checked in 1.272 seconds. 0 problems found.★
-------------------------------------------------------
【参考】/etc/amanda/DailySet1/curinfoが管理用データベースに相当する部分
初回バックアップ実行時に自動で作られる。
amanda運用では、これを含むバックアップを別に行う必要あり
■■バックアップ実行
【□】 amdump DailySet1
amdump DailySet1 force
■■作成された仮想ライブラリの中身
【□】 tree /vtl01
/vtl01
|-- data -> slot5
|-- info
|-- slot1
| |-- 00000.DailySet1-01
| `-- 00001.localhost._backtarget.0
|-- slot10
| `-- 00000.DailySet1-10
|-- slot2
| |-- 00000.DailySet1-02
| `-- 00001.localhost._backtarget.1
|-- slot3
| |-- 00000.DailySet1-03
| `-- 00001.localhost._backtarget.1
|-- slot4
| |-- 00000.DailySet1-04
| `-- 00001.localhost._backtarget.1
|-- slot5
| `-- 00000.DailySet1-05
|-- slot6
| `-- 00000.DailySet1-06
|-- slot7
| `-- 00000.DailySet1-07
|-- slot8
| `-- 00000.DailySet1-08
|-- slot9
| `-- 00000.DailySet1-09
`-- state
【□】 ls -lR /vtl01
スロットのシンボリックリンクがバックアップのたびに切り替わっていく
シンボリックリンクの張られたスロットのディレクトリがカレントのスロット
(ドライブにテープがささっているようなイメージ)
-bash-3.2$ ls -lR /vtl01
/vtl01:
合計 44
lrwxrwxrwx 1 amandabackup disk 5 3月 20 11:24 data -> slot5★
-rw-r--r-- 1 amandabackup disk 0 3月 20 11:03 info
drwxr-xr-x 2 amandabackup disk 4096 3月 20 10:08 slot1
drwxr-xr-x 2 amandabackup disk 4096 3月 20 10:00 slot10
drwxr-xr-x 2 amandabackup disk 4096 3月 20 10:09 slot2
drwxr-xr-x 2 amandabackup disk 4096 3月 20 11:02 slot3
drwxr-xr-x 2 amandabackup disk 4096 3月 20 11:03 slot4
drwxr-xr-x 2 amandabackup disk 4096 3月 20 10:00 slot5
drwxr-xr-x 2 amandabackup disk 4096 3月 20 10:00 slot6
drwxr-xr-x 2 amandabackup disk 4096 3月 20 10:00 slot7
drwxr-xr-x 2 amandabackup disk 4096 3月 20 10:00 slot8
drwxr-xr-x 2 amandabackup disk 4096 3月 20 10:00 slot9
-rw------- 1 amandabackup disk 150 3月 20 11:24 state
/vtl01/slot1:
合計 976
-rw------- 1 amandabackup disk 32768 3月 20 10:08 00000.DailySet1-01
-rw------- 1 amandabackup disk 959361 3月 20 10:08 00001.localhost._backtarget.0
/vtl01/slot10:
合計 32
-rw------- 1 amandabackup disk 32768 3月 20 10:00 00000.DailySet1-10
/vtl01/slot2:
合計 68
-rw------- 1 amandabackup disk 32768 3月 20 10:09 00000.DailySet1-02
-rw------- 1 amandabackup disk 33709 3月 20 10:09 00001.localhost._backtarget.1
/vtl01/slot3:
合計 68
-rw------- 1 amandabackup disk 32768 3月 20 11:02 00000.DailySet1-03
-rw------- 1 amandabackup disk 33710 3月 20 11:02 00001.localhost._backtarget.1
/vtl01/slot4:
合計 68
-rw------- 1 amandabackup disk 32768 3月 20 11:03 00000.DailySet1-04
-rw------- 1 amandabackup disk 33709 3月 20 11:03 00001.localhost._backtarget.1
/vtl01/slot5:
合計 32
-rw------- 1 amandabackup disk 32768 3月 20 10:00 00000.DailySet1-05
/vtl01/slot6:
合計 32
-rw------- 1 amandabackup disk 32768 3月 20 10:00 00000.DailySet1-06
/vtl01/slot7:
合計 32
-rw------- 1 amandabackup disk 32768 3月 20 10:00 00000.DailySet1-07
/vtl01/slot8:
合計 32
-rw------- 1 amandabackup disk 32768 3月 20 10:00 00000.DailySet1-08
/vtl01/slot9:
合計 32
-rw------- 1 amandabackup disk 32768 3月 20 10:00 00000.DailySet1-09
■■作成された仮想ライブラリのファイルを直接展開
amandaのメリットであるバックアップファイルの直接利用
仮想ライブラリのスロットをそのままtar.gzとして使えるわけではなかった。
方法を再確認する必要があるが、以下の方法によりスロットにあるバックアップを
tar.gzとして取り出せることを確認。
スロットに格納された仮想テープからddコマンドでヘッダ部分をスキップし出力。
-bash-3.2$ cd /vtl01/slot1
-bash-3.2$ ls -l
合計 976
-rw------- 1 amandabackup disk 32768 3月 20 10:08 00000.DailySet1-01
-rw------- 1 amandabackup disk 959361 3月 20 10:08 00001.localhost._backtarget.0
-bash-3.2$
ヘッダに相当する32KBを読み飛ばしてファイルに出力する。
【□】 dd if=00001.localhost._backtarget.0 of=tmp_backtarget.0.tar.gz bs=1024 skip=32
【□】 tar ztvf tmp_backtarget.0.tar.gz
tar.gzファイルとして認識され、ファイルが表示された
【□】 tar zxvf tmp_backtarget.0.tar.gz
ファイルのリストアができた。
[root@dbsv slot1]# tar ztvf tmp_backtarget.0.tar.gz
drwxr-xr-x root/root 5 2012-03-20 08:15:40 ./
drwxr-xr-x root/root 1546 2012-03-20 08:15:50 ./t1/
-rw-r--r-- root/root 2518 2009-07-13 19:21:16 ./t1/DIR_COLORS
-rw-r--r-- root/root 2420 2009-07-13 19:21:16 ./t1/DIR_COLORS.xterm
-rw-r--r-- root/root 92794 2007-05-29 21:10:04 ./t1/Muttrc
-rw-r--r-- root/root 0 2007-05-29 21:10:04 ./t1/Muttrc.local
-rw-r--r-- root/root 2562 2008-01-15 22:55:32 ./t1/a2ps-site.cfg
:
:
:
:
念のためバックアップ元ディレクトリとdiffで一致することを確認
以上