Linux/rsync
rsync †
サーバ側の設定 †
インストール †
# yum install xinetd
/etc/xinetd.d/rsync修正 †
「disable = yes」を「disable = no」へ変更
# vi /etc/xinetd.d/rsync -------------------------------------- # default: off # description: The rsync server is a good addition to an ftp server, as it # allows crc checksumming etc. service rsync { disable = yes ↓ disable = no socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = --daemon log_on_failure += USERID }
hosts.allowの修正 †
アクセス許可のネットワークを記述する。
# vi /etc/hosts.allow rsync : 127.0.0.1 : allow rsync : 192.168.11. : allow
起動 †
# /etc/init.d/xinetd start # chkconfig xinetd on
rsyncの設定ファイル †
# cat /etc/rsyncd.conf log file=/var/log/rsyncd.log secrets file=/etc/rsyncd.secrets hosts allow = 38.99.89.185/32 hosts deny = * transfer logging = true auth users = backup list = true uid = root gid = root [www] comment = html contents path = /var/www
secretsの用意 †
# cat /etc/rsyncd.secrets backup:xxbackup
クライアント側(バックアップを取る側の用意) †
# cat /etc/rsyncd.pass xxbackup
コマンド †
# rsync -av --password-file=/etc/rsyncd.pass rsync://back@nagi01.hsinc.com/www /home/backups/nagios/