Search for
Login | Username Password Forgot? | Email: | Create Account
Non English | Entries: 1173 | Views: 95 | Modified: 4 hours ago | | Add to My Feeds
Report

Artikel ini merupakan bagian terakhir dari tutorial membackup data di Debian Lenny menggunakan Amanda. Setelah kita menginstal dan mengkonfigurasi Amanda pada server dan client, nah di bagian terakhir ini kita akan melakukan test konfigurasi sekaligus test backup dan restore.

3.3 Tests

3.3.1 Test Konfigurasi

Login sebagai user backup on bckserver and ketik perintah berikut:

$ amcheck DailySet1

Amanda Tape Server Host Check
—————————–
Holding disk /dumps/: 48800396 kB disk space available, using 48800396 kB
slot 2: read label `DailySet1-02′, date `20100607′
cannot overwrite active tape DailySet1-02
slot 3: read label `DailySet1-03′, date `X’
NOTE: skipping tape-writable test
Tape DailySet1-03 label ok
NOTE: host info dir /etc/amanda/DailySet1/curinfo/bckclient.mydomain.com does not exist
NOTE: it will be created on the next run.
NOTE: index dir /etc/amanda/DailySet1/index/bckclient.mydomainman .com does not exist
NOTE: it will be created on the next run.
Server check took 0.115 seconds

Amanda Backup Client Hosts Check
——————————–
Client check: 1 host checked in 0.132 seconds, 0 problems found

(brought to you by Amanda 2.5.2p1)

 

3.3.2 Test Backup

Login sebagai user backup on bckserver and ketik perintah berikut:

$ amdump DailySet1

Note: untuk memaksa agar program membackup semuanya, ketik perintah berikut sebelum perintah amdump :

$ amadmin DailySet1 force bckclient.mydomain.com

Setelah backup selesai, cek email backup_admin@mydomain.com untuk melihat pemberitahuannya.

 Hostname: bckserver
Org     : DailySet1
Config  : DailySet1
Date    : June 7, 2010
These dumps were to tape DailySet1-03.
The
next tape Amanda expects to use is: a new tape.
The next new tape
already labelled is: DailySet1-04.
STATISTICS:

                          Total       Full      Incr.
                        --------    --------   --------
Estimate Time (hrs:min)    0:00
Run Time      (hrs:min)    0:06
Dump Time (hrs:min)        0:05       0:05       0:00
Output Size (meg)         766.7      766.7        0.0
Original Size (meg)      1363.0     1363.0        0.0
Avg Compressed Size    56.3       56.3        --
Filesystems Dumped            1          1          0
Avg Dump Rate (k/s)      2730.3     2730.3        -- 

Tape Time (hrs:min)        0:01       0:01       0:00
Tape Size (meg)           766.8      766.8        0.0
Tape Used               15.0       15.0        0.0
Filesystems Taped             1          1          0

Chunks Taped                  0          0          0
Avg Tp Write Rate (k/s)  9490.5     9490.5        --
USAGE BY TAPE:
  Label              Time      Size      %    Nb    Nc
  DailySet1-03       0:01   785152k   15.0     1     0
NOTES:
  planner: tapecycle (9) <= runspercycle (10)
  planner: Adding new disk bckclient.mydomain.com:/.
  driver: WARNING: This is not the first amdump run today. Enable the usetimestamps option in the configuration file if you want to run amdump more than once per calendar
 day.
  taper: tape DailySet1-03 kb 785184 fm 1 [OK]
  small estimate: bckclient.mydomain.com / 0
                  est: 697920k    out 785152k
DUMP SUMMARY:

                 DUMPER STATS               TAPER STATS
HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS   KB/s MMM:SS   KB/s
-------------------------- ------------------------------------- -------------
bckclient    /           0 1395720  785152   56.3    4:48 2730.3   1:23 9490.4
bckclient    /boot       0   16320   15520   95.1    0:04 4324.4   0:00 98858.5
bckclient    -mysite.com 0   34750   11488   33.1    0:09 1228.3   0:01 16425.6
(brought to you by Amanda version 2.5.2p1)

$ amadmin DailySet1 find

date       host                           disk                    lv tape or file file part status
2010-06-07 bckclient.mydomain.com         /                        1 DailySet1-04    1   -- OK
2010-06-07 bckclient.mydomain.com         /                        1 DailySet1-05    1   -- OK
2010-06-07 bckclient.mydomain.com         /                        1 DailySet1-06    1   -- OK
2010-06-07 bckclient.mydomain.com         /                        0 DailySet1-01    0   -- FAILED (dumper) [port open: Connection timed out]
2010-06-07 bckclient.mydomain.com         /                        0 DailySet1-01    0   -- FAILED (dumper) [port open: Connection timed out]
2010-06-07 bckclient.mydomain.com         /                        0 DailySet1-02    0   -- FAILED (dumper) [port open: Connection timed out]
2010-06-07 bckclient.mydomain.com         /                        0 DailySet1-02    0   -- FAILED (dumper) [port open: Connection timed out]
2010-06-07 bckclient.mydomain.com         /                        0 DailySet1-03    1   -- OK
2010-06-07 bckclient.mydomain.com         /                        0 DailySet1-07    1   -- OK
2010-06-07 bckclient.mydomain.com         /                        0 DailySet1-08    3   -- OK
2010-06-07 bckclient.mydomain.com         /boot                    0 DailySet1-08    1   -- OK
2010-06-07 bckclient.mydomain.com         /var/www/www.mysite.com  0 DailySet1-08    2   -- OK

 

3.4 Penjadwalan Backup

Backup harian, setiap hari pada jam 1:00AM:

# su  backup -c “crontab -e”

0 1 * * 1-7 /usr/sbin/amdump DailySet1

 

3.5 Restore

3.5.1 Konfigurasi Backup Client

Login sebagai user root pada bckclient.

Buat file amanda-client.conf :

# su backup -c “mkdir /etc/amanda”

# vi /etc/amanda/amanda-client.conf

conf "DailySet1" # your config name (used for restore)
index_server "bckserver.mydomain.com" # your amindexd server
tape_server "bckserver.mydomain.com" # your amidxtaped server
auth "bsdtcp"

# ls -ltr /etc/amanda/DailySet1/amanda-client.conf

lrwxrwxrwx 1 root root 30 mai 25 17:50 /etc/amanda/DailySet1/amanda-client.conf -> /etc/amanda/amanda-client.conf

Note: Jika anda menggunakan backup mingguan dan harian untuk client yang sama, anda harus menspesifikasikan conf yang tepat (WeeklySet1 atau DailySet1) untuk restore.

 

3.5.2 Recover

Login sebagai user root pada bckclient, pindah ke direktori yang pas untuk restore (/tmp misalnya) dan ketik perintah berikut:

# amrecover

AMRECOVER Version 2.5.2p1. Contacting server on bckserver.mydomain.com …
220 bckserver AMANDA index server (2.5.2p1) ready.
Setting restore date to today (2010-06-07)
200 Working date set to 2010-06-07.
200 Config set to DailySet1.
501 Host bckclient is not in your disklist.
Trying host bckclient.mydomain.com …
200 Dump host set to bckclient.mydomain.com.
Use the setdisk command to choose dump disk to recover

amrecover> listdisk

200- List of disk for host bckclient.mydomain.com
201- /

201- /var/www/www.mysite.com
201- /boot

amrecover> setdisk /var/www/www.mysite.com

200 Disk set to /var/www/www.mysite.com.

amrecover> ls

2010-06-07 xmlrpc/
2010-06-07 tmp/
2010-06-07 templates/
2010-06-07 robots.txt
2010-06-07 plugins/
2010-06-07 modules/
2010-06-07 logs/
2010-06-07 libraries/
2010-06-07 language/
2010-06-07 index2.php
2010-06-07 index.php
2010-06-07 includes/
2010-06-07 images/
2010-06-07 htaccess.txt
2010-06-07 configuration.php-dist
2010-06-07 configuration.php
2010-06-07 components/
2010-06-07 cache/
2010-06-07 aicontactsafe/
2010-06-07 administrator/
2010-06-07 LICENSES.php
2010-06-07 LICENSE.php
2010-06-07 INSTALL.php
2010-06-07 CREDITS.php
2010-06-07 COPYRIGHT.php
2010-06-07 CHANGELOG.php
2010-06-07 .htaccess
2010-06-07 .

amrecover> add *

Added dir /xmlrpc/ at date 2010-06-07
Added dir /tmp/ at date 2010-06-07
Added dir /templates/ at date 2010-06-07
Added file /robots.txt
Added dir /plugins/ at date 2010-06-07
Added dir /modules/ at date 2010-06-07
Added dir /logs/ at date 2010-06-07
Added dir /libraries/ at date 2010-06-07
Added dir /language/ at date 2010-06-07
Added file /index2.php
Added file /index.php
Added dir /includes/ at date 2010-06-07
Added dir /images/ at date 2010-06-07
Added file /htaccess.txt
Added file /configuration.php-dist
Added file /configuration.php
Added dir /components/ at date 2010-06-07
Added dir /cache/ at date 2010-06-07
Added dir /aicontactsafe/ at date 2010-06-07
Added dir /administrator/ at date 2010-06-07
Added file /LICENSES.php
Added file /LICENSE.php
Added file /INSTALL.php
Added file /CREDITS.php
Added file /COPYRIGHT.php
Added file /CHANGELOG.php
Added file /.htaccess

amrecover> extract

Extracting files using tape drive chg-disk on host bckserver.mydomain.com.
The following tapes are needed: DailySet1-08

Restoring files into directory /tmp

Continue [?/Y/n]? y

Extracting files using tape drive chg-disk on host bckserver.mydomain.com.
Load tape DailySet1-08 now

Continue [?/Y/n/s/t]? y

./administrator/
./administrator/backups/

Note:

pindah direktori gunakan cd

pindah tanggal gunakan setdate

restore ke host lain gunakan sethost

4. Referensi yang Digunakan untuk membuat Tutorial ini:

The 15-Minute Backup Solution

Quick start

Disk Based Backups With Amanda On Debian Etch

 

Selamat mencoba… ;)

 

Sumber: HowtoForge.com

Artikel Terkait


More from Bisnis Having Fun


^ Back To Top