CentOSに afbackup 3.3.8.1 installメモ(HDD版)

afbackup 3.3.8.1をダウンロード

# cd /usr/local/src/
# wget http://jaist.dl.sourceforge.net/sourceforge/afbackup/afbackup-3.3.8.1.tar.gz
# tar zxf afbackup-3.3.8.1.tar.gz
# cd afbackup-3.3.8.1

libdes-4.04bをringよりダウンロード
afbackupのデフォルトは ../libdes を見に行くのでディレクトリを変更

# wget http://aist.ring.gr.jp/pub/net/Crypto/libeay/libdes-4.04b.tar.gz
# taz zxf libdes-4.04b.tar.gz
# mv des libdes


暗号化関連のヘッダファイル、ライブラリの PATH をいじらないといけないのでリンクを張る。

# locate des.h
/usr/include/rpc/auth_des.h
/usr/include/rpc/rpc_des.h
/usr/include/openssl/des.h
/usr/include/kerberosIV/des.h
/usr/include/linux/cyclades.h
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/regnodes.h
# ln -s /usr/include/openssl/des.h /usr/include/des.h
# locate libcrypto.a
/usr/lib/libcrypto.a
# ln -s /usr/lib/libcrypt.a /usr/lib/libdes.a

configure --with-desのオプションはデフォルトなので省略可能

# /usr/local/src/afbackup-3.3.8.1/configure --with-des --with-des-header=des.h --with-des-ldflag=-ldes --with-zlib --with-zlib-include=/usr/include --with-zlib-libdir=/usr/lib

make & make install 認証キーを聞かれるが後で作成可能

# make
Please enter at least 5 characters as a unique
key for some encryption used for authenticating
the client to the server.

Key:
〜 省略 〜
# make install

認証キーの作成(AuthPassWordで作成の場合)

# echo "AuthPassWord" > /usr/local/backup/server/etc/cryptkey
# chmod 400 /usr/local/backup/server/etc/cryptkey


serverのbackup.conf編集後と編集前

# cd /usr/local/backup/server/etc
# diff backup.conf backup.conf.org
5c5< ServerIdentifier: Manager

    • -

> #ServerIdentifier:
10c10< Backup-Device: /mnt/backup/afbackup/vol

    • -

> Backup-Device: /dev/nst0
19c19< Cartridge-Handler: 1

    • -

> Cartridge-Handler: 0
22c22< Number Of Cartridges: 70

    • -

> Number Of Cartridges: 10
29c29< Cartridge-Sets: 1-70

    • -

> #Cartridge-Sets:
32c32< Max Bytes Per File: 104857600

    • -

> Max Bytes Per File: 50000000
35c35< Max Bytes Per Tape: 1048576000

    • -

> #Max Bytes Per Tape:
51c51< Cart-Insert-Gracetime: 0

    • -

> Cart-Insert-Gracetime: 70
75c75< SetFile-Command: exit 0

    • -

> SetFile-Command: sh -c "mt -f %d rewind && %B/__mt -f %d fsf %m"
78c78< SkipFiles-Command: exit 0

    • -

> SkipFiles-Command: %B/__mt -f %d fsf %n
81c81< Set-Cart-Command: /bin/rm -f %d;mkdir -p %d.%n;ln -s %d.%n %d;exit 0

    • -

> #Set-Cart-Command:
86c86< Change-Cart-Command: exit 0

    • -

> Change-Cart-Command: mt -f %d rewoffl
93c93< Erase-Tape-Command: /bin/rm -f %d/*;exit 0

    • -

> #Erase-Tape-Command:
132c132< Encryption-Key-File: %C/cryptkey

    • -

> #Encryption-Key-File:


xinet.dでafbackupの設定(userはbackupユーザーで動かす)

# vi /etc/xinetd.d/afbackup
service afbackup
{
flags = REUSE NAMEINARGS
socket_type = stream
protocol = tcp
wait = no
user = backup
server = /usr/local/backup/server/bin/afserver
server_args = /usr/local/backup/server/bin/afserver /usr/local/backup/server/etc/backup.conf
}

# /etc/init.d/xinetd reload
Reloading configuration: [ OK ]

接続できるか確認

# telnet localhost afbackup
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
afbackup 3.3.8.1

AF's backup server ready.

afmbackup(必要であれば)

# vi /etc/xinetd.d/afmbackup
service afmbackup
{
flags = REUSE NAMEINARGS
socket_type = stream
protocol = tcp
wait = yes
user = backup
server = /usr/local/backup/server/bin/afmserver
server_args = /usr/local/backup/server/bin/afmserver /usr/local/backup/server/etc/backup.conf
}

/etc/servicesの確認(なければ編集して足すこと)

# grep afbackup /etc/services
afbackup 2988/tcp # Afbackup system
afbackup 2988/udp # Afbackup system
# grep afmbackup /etc/services
afmbackup 2989/tcp # Afmbackup system
afmbackup 2989/udp


HDDにバックアップする準備

# pwd
/mnt/backup/afbackup
# mkdir -p vol.1
# ll
total 0
drwxrwsr-x 1 backup backup 0 Dec 31 01:12 vol.1
# ln -s vol.1 vol
# ll
total 0
lrwxrwxrwx 1 backup backup 5 Dec 31 01:12 vol -> vol.1
drwxrwsr-x 1 backup backup 0 Dec 31 01:12 vol.1

カートリッジの設定(server.confのBackup-Device:が設定される)

# /usr/local/backup/server/bin/cartis 1
# /usr/local/backup/server/bin/cartis -i 1 1

以上でAFbackupサーバー側の設定は完了です

メモ
1048576000 = 1G
104857600 = 100M * 10がディレクトリにできるので、もっと細かくて多くてもいいかも


参考
蘊蓄板: WEB+DB PRESS Vol.26
INSTALL-jp.txt
README-jp.txt

3.3.8.1 => 3.4 Changes

3.3.8.1 - 3.4
- Patterns %n and %m supported for the server's Init-Media-Command
- "Bug" 942640 (IMHO: Feature Request) fixed: The serverside ring
buffer fill status is no longer written to the status file / display.
If someone wants to see them, build with the environment variable
EXTERNAL_INCLUDES set to -DAFB_SERVER_SHOW_BUFFER_STATUS before
running configure or Install
- Client side backup progress log implemented: New configuration
parameter added, current status is written to .../client/var/progress
and can e.g. be watched using the script
progress_display -f 3 /path/to/client/var/progress
- To make the packer/unpacker deal with arbitrary path lengths/depths
memory must be allocated dynamically. The new version implements a
highly efficient combination of dynamic and static memory allocation
depending on the current requirements. Thus: Bug 582829 fixed
- If someone uses the afclient program as a simple file packer like
tar: unpacking an archive of absolute paths forcing things to be
relative and giving option -r two or three times to adapt the targets
of symbolic links to be relative as well, if they are absolute in
the archive, now finally does the right things. Up to now this was
just a mess. But this functionality was never used when running
the afbackup components in the normal way, so noone might ever have
noticed that.
- uninstall targets added to Makefile, contributed by Jeannot Langlois
at linuxmail DOT org, somewhat reworked, particularly turned the
dependencies around: the common stuff may be removed with uninstall,
but not with uninstall.client or uninstall.server only, and the like
(to be frank: i don't see too much sense in an uninstall make target,
IMHO install/uninstall should be subject of a package management)
- neglible bug in label_tape fixed: In extremely rare situations the
program wanted to read from stdout after issuing a message
- fix label_tape and cartis to write files as the user, under whose id
the server runs (device owner / var directory owner)
- With Solaris over NFS version 4 setting ACLs fails, when the numerical
ID cannot be resolved to a name, so these particular ACL entries are
skipped now and setting the ACL is attempted a second time
- Implementation problem with varargs fixed. When using v*printf or
vsyslog the call must be enclosed in va_start and va_end (didn't
find a hint to this in any documentation), otherwise strange data
appears or even segfaults occur, the latter esp. with recent glibc
- Running full_backup/incr_backup/afrestore/afverify, when another
process is already owning a lock, the operator now has the choice
whether to steal a possibly existing lock or to leave it to the
already running process
- Restore can be limited to certain backups supplying a timerange for
the backup date (not only the file modification time), see options
-A and -B of afrestore
- German translation errors fixed (Bug 1238131, thx to Torsten Werner)

3.4 => 3.5 Changes

3.4 - 3.5
- Bug fixed: cart_ctrl -i aborted on unreadable tape
- Minor implementation enhancements e.g. for performance
- MacOS-X (10) supported, at least the client side has been tested
- Support for barcode tape labels, thus
- cart_ctl notably extended: Detailed listings, attribute assignments,
cartridge descriptions etc.
- Usage output of server and mserver corrected
- Bug fixed: When packing (backup) with an external processing command
(e.g. compression) and later during unpack the reverse processing
command can not be executed, the afclient program terminated without
any message