Amanda

Contents

Instalacja

W Debianie Amanda składa się z 3 pakietów: amanda-server, amanada-client i amanda-common. W przypadku instalacji serwera zainstalują się dwa pozostałe pakiety. Po instalacji należy przerestartować demona inetd (domyślnie on będzie używany do obsługi programu).

Testowe uruchomienie

Program musi być uruchamiany z użytkownika backup. Jeżeli jesteśmy niecierpliwi i chcemy sprawdzić czy w ogóle coś działa możemy wykonać polecenie:

terminal-3-67:/etc/amanda/DailySet1# sudo -u backup amcheck -cl DailySet1

Program wyświetli coś podobnego do poniżej:

terminal-3-67:/etc/amanda/DailySet1# sudo -u backup amcheck -cl DailySet1
Amanda Tape Server Host Check
-----------------------------
ERROR: tape list /etc/amanda/DailySet1/tapelist: parse error
ERROR: holding disk /space: statfs: No such file or directory
NOTE: skipping tape checks
NOTE: info dir /var/lib/amanda/DailySet1/curinfo: does not exist
NOTE: it will be created on the next run
Server check took 0.042 seconds

Amanda Backup Client Hosts Check
--------------------------------
Client check: 0 hosts checked in 0.003 seconds, 0 problems found

Jak widać program jest gotowy do akcji, trzeba go tylko skonfigurować.

Konfiguracja programu

 

Dla każdego backupowanego serwera (zasobu) należy stworzyć osobny katalog. Tam wkopiować plik amanda.conf odpowiadający za konfigurację programu względem tego zasobu.

Nowy zasób

 

terminal-3-67:/etc/amanda/Dom# mkdir /var/log/amanda/Dom
terminal-3-67:/etc/amanda/Dom# chown backup.backup /var/log/amanda/Dom

terminal-3-67:/etc/amanda/Dom# mkdir -p  /var/lib/amanda/Dom/curinfo
terminal-3-67:/etc/amanda/Dom# chown backup.backup /var/lib/amanda/Dom/curinfo

Tworzenie taśm

terminal-3-67:/data3/DailySet1# su - backup /usr/sbin/amlabel   DailySet1 DOM1 slot 1
labeling tape in slot 1 (file:/data3/DailySet1):
rewinding, reading label, not an amanda tape
rewinding, writing label DOM1, checking label, done.

terminal-3-67:/data3/DailySet1# su - backup /usr/sbin/amlabel   DailySet1 DOM2 slot 2
labeling tape in slot 2 (file:/data3/DailySet1):
rewinding, reading label, not an amanda tape
rewinding, writing label DOM2, checking label, done.

...

Sprawdzenie konfiguracji

terminal-3-67:/data3/DailySet1# sudo -u backup amcheck DailySet1/
Amanda Tape Server Host Check
-----------------------------
Holding disk /data3: 5444828 KB disk space available, that's plenty
amcheck-server: slot 8: date X        label DOM8 (new tape)
NOTE: skipping tape-writable test
Tape DOM8 label ok
NOTE: info dir /var/lib/amanda/DailySet1/curinfo: does not exist
NOTE: it will be created on the next run
NOTE: index dir /var/lib/amanda/DailySet1/index/localhost: does not exist
Server check took 0.248 seconds

Amanda Backup Client Hosts Check
--------------------------------
Client check: 1 host checked in 0.080 seconds, 0 problems found

(brought to you by Amanda 2.4.4p3)

Przegląd taśm

terminal-3-67:/var/lib/amanda# sudo -u backup amtape DailySet1 show
amtape: scanning all 8 slots in tape-changer rack:
slot 8: date X        label DOM8
slot 1: date X        label DOM1
slot 2: date X        label DOM2
slot 3: date X        label DOM3
slot 4: date X        label DOM4
slot 5: date X        label DOM5
slot 6: date X        label DOM6
slot 7: date X        label DOM7

Sprawdzanie statusu backupu

terminal-3-67:/etc/amanda/Dom# sudo -u backup amstatus Dom
Using /var/log/amanda/Dom/amdump from Sun May 22 14:07:28 CEST 2005

localhost:hda6 0  1916680k dumping  1124608k ( 58.67%) (14:07:28)

SUMMARY          part      real  estimated
                           size       size
partition       :   1
estimated       :   1              1916680k
flush           :   0         0k
failed          :   0                    0k           (  0.00%)
wait for dumping:   0                    0k           (  0.00%)
dumping to tape :   0                    0k           (  0.00%)
dumping         :   1   1124608k   1916680k ( 58.67%) ( 58.67%)
dumped          :   0         0k         0k (  0.00%) (  0.00%)
wait for writing:   0         0k         0k (  0.00%) (  0.00%)
wait to flush   :   0         0k         0k (100.00%) (  0.00%)
writing to tape :   0         0k         0k (  0.00%) (  0.00%)
failed to tape  :   0         0k         0k (  0.00%) (  0.00%)
taped           :   0         0k         0k (  0.00%) (  0.00%)
  tape 1        :   0         0k         0k (  0.00%) DOMEK2
3 dumpers idle  : not-idle
taper idle
network free kps:       570
holding space   :   3203232k ( 62.56%)
 dumper0 busy   :  0:00:00  (  0.00%)
 0 dumpers busy :  0:00:00  (  0.00%)
 1 dumper busy  :  0:00:00  (  0.00%)

Odzyskanie danych z backupu

Odszukanie danych na taśmie (która to taśma)

 

Załadowanie taśmy

sudo -u backup amtape Dom slot 2

Odzyskanie danych

Odzyskamy dane znajdujące się w katalogu /data2:

terminal-3-67:/data2# cd /data2

terminal-3-67:/data2# amrecover Dom
AMRECOVER Version 2.4.4p3. Contacting server on localhost ...
220 localhost AMANDA index server (2.4.4p3) ready.
200 Access OK
Setting restore date to today (2005-05-23)
200 Working date set to 2005-05-23.
Scanning /data3/tmp...
200 Config set to Dom.
200 Dump host set to localhost.
Trying disk /data2 ...
Trying disk hda6 ...
$CWD '/data2' is on disk 'hda6' mounted at '/data2'.
200 Disk set to hda6.
/data2

Następnie sprawdźmy co możemy odzyskać z backupu:

amrecover> ls
2005-05-22 .
2005-05-22 conf_mysql1.tar.gz
2005-05-22 conf_mysql1/
2005-05-22 filmy/
2005-05-22 gry/
2005-05-22 ksiazki informatyczne/
2005-05-22 ksiazki/
2005-05-22 muzyka/

Przy pomocy polecenia add dodajemy określone pliki do listy plików przeznaczonych do odzyskania z backupu:

amrecover> add *
Added dir / at date 2005-05-22
Added /conf_mysql1.tar.gz
Added dir /conf_mysql1 at date 2005-05-22
Added dir /filmy at date 2005-05-22
Added dir /gry at date 2005-05-22
Added dir /ksiazki informatyczne at date 2005-05-22
Added dir /ksiazki at date 2005-05-22
Added dir /muzyka at date 2005-05-22

 

amrecover> extract

Extracting files using tape drive file:/data3/Dom on host localhost.
The following tapes are needed: DOMEK2

Restoring files into directory /data2
Continue [?/Y/n]?

Extracting files using tape drive file:/data3/Dom on host localhost.
Load tape DOMEK2 now
Continue [?/Y/n/s/t]?
./
./bond 007 golgeneye/
./conf_mysql1/
./conf_mysql1/pam.d/
./filmy/
./gry/
./ksiazki/

Po zakończeniu okaże się iż mamy wszystkie dane odzyskane…

Dodaj komentarz