他のマシン同様、 バックアップサーバである初代玄箱へリモートバックアップを取る。
sil:~# 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 1s (198kB/s) Selecting previously deselected package rsync. (Reading database ... 12847 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) ... sil:~#
sil:~# vi /etc/rsyncd.conf : : sil:~# cat /etc/rsyncd.conf [Backup] path = /mnt/Backup hosts allow = 192.168.1.0/24 192.168.2.0/24 sil:~#
sil:~# echo "rsync stream tcp nowait root /usr/sbin/tcpd /usr/bin/rsy nc --daemon" >> /etc/inetd.conf sil:~# tail !$ tail /etc/inetd.conf #:RPC: RPC based services #:HAM-RADIO: amateur-radio services #:OTHER: Other services ## netbios-ssn stream tcp nowait root /usr/sbin/tcpd /usr/sbin/smbd ftp stream tcp nowait root /usr/sbin/tcpd ftpd rsync stream tcp nowait root /usr/sbin/tcpd /usr/bin/rsync --daemon sil:~#
sil:~# kill -HUP `cat /var/run/inetd.pid ` sil:~#
-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 # : # (略) # : #------------------------------------- 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$バックアップ専用マシンなので、スクリプトの最後に
[root@kuro root]# sh /usr/local/sbin/Backup.to.kuro : : : receiving file list ... ./ sil/ sil/sil-bin.Sun.tar.gz sil/sil-boot.Sun.tar.gz sil/sil-buffalo.Sun.tar.gz sil/sil-dev.Sun.tar.gz sil/sil-etc.Sun.tar.gz sil/sil-home.Sun.tar.gz sil/sil-initrd.Sun.tar.gz sil/sil-lib.Sun.tar.gz sil/sil-media.Sun.tar.gz sil/sil-opt.Sun.tar.gz sil/sil-root.Sun.tar.gz sil/sil-sbin.Sun.tar.gz sil/sil-selinux.Sun.tar.gz sil/sil-srv.Sun.tar.gz sil/sil-sys.Sun.tar.gz sil/sil-usr.Sun.tar.gz sil/sil-var.Sun.tar.gz : :OK
|
← 玄箱/T4 は PowerPC |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ cron の設定変更 |