直線距離で 30cm、同じラックの上の段の別マシンへのバックアップは 「ディザスタ」とは言わないか。
ude:~# apt-get install rsync Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: openssh-client openssh-server The following NEW packages will be installed: rsync 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 340kB of archives. After this operation, 672kB of additional disk space will be used. Get:1 http://ftp.jp.debian.org lenny/main rsync 3.0.3-2 [340kB] Fetched 340kB in 3s (113kB/s) Selecting previously deselected package rsync. (Reading database ... 10095 files and directories currently installed.) Unpacking rsync (from .../rsync_3.0.3-2_armel.deb) ... Processing triggers for man-db ... Setting up rsync (3.0.3-2) ... ude:~#
ude:~# vi /etc/rsyncd.conf
:
ude:~# cat !$
cat /etc/rsyncd.conf
[Backup]
path = /mnt/Backup
hosts allow = 192.168.2.0/24
[linkstation]
path = /mnt/linkstation
hosts allow = 192.168.2.0/24
ude:~#
/mnt/linkstation も 別途バックアップを取る。
ude:~# grep rsync /etc/inetd.conf ude:~#ないので追加する。
ude:~# /etc/inetd.conf : : ude:~# grep rsync /etc/inetd.conf rsync stream tcp nowait root /usr/sbin/tcpd /usr/bin/rsync --daemon ude:~#inetd に設定を反映する。
ude:~# kill -HUP `cat /var/run/inetd.pid` ude:~#
-bash-2.05b$ cat /etc/melco/timer_sleep on<>5:30<>6:00 -bash-2.05b$5時半になれば起動、6時までの間に 全 LinkStation に rsync かけまわり、 全マシンのバックアップを取得している。
-bash-2.05b$ cat /usr/local/sbin/Backup.to.kuro
#! /bin/sh
LOCKFILE=/tmp/`basename $0`
if [ -f $LOCKFILE ]
then
echo $0 already running
exit
fi
touch $LOCKFILE
#- giga ------------------------------
cd /mnt/home
su yasunari -c "nice rsync -rtuvpogDtlH rsync://giga/home ."
#- ude ------------------------------
cd /mnt/home/linkstation
su yasunari -c "nice rsync -rtuvpogDtlH rsync://ude/linkstation ."
#-------------------------------------
cd /mnt
for SRCHOST in giga sil mt ns ude #link gawa
do
su yasunari -c "nice rsync -rtuvpogtlH rsync://$SRCHOST/Backup Backup"
done
#-------------------------------------
rm -f $LOCKFILE
#-------------------------------------
# AVR
echo -n "EEEE" > /dev/ttyS1
/sbin/shutdown -h now
-bash-2.05b$
バックアップが終われば、シャットダウン。
|
|
← バックアップ |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ eth1addr のセット |