このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン | |||
01_linux:01_net:14_rsync [2016/12/08 00:06] – [コマンド] matsui | 01_linux:01_net:14_rsync [2017/06/20 01:35] (現在) – matsui | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== 14 rsync ====== | ||
+ | ===== サーバ側の設定 ===== | ||
+ | |||
+ | ==== インストール ==== | ||
+ | < | ||
+ | # yum install xinetd | ||
+ | </ | ||
+ | |||
+ | === / | ||
+ | |||
+ | 「disable = yes」を「disable = no」へ変更 | ||
+ | |||
+ | < | ||
+ | # vi / | ||
+ | -------------------------------------- | ||
+ | # default: off | ||
+ | # description: | ||
+ | service rsync | ||
+ | { | ||
+ | disable = yes | ||
+ | ↓ | ||
+ | disable = no | ||
+ | socket_type | ||
+ | wait = no | ||
+ | user = root | ||
+ | server | ||
+ | server_args | ||
+ | log_on_failure | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === hosts.allowの修正 === | ||
+ | |||
+ | |||
+ | アクセス許可のネットワークを記述する。 | ||
+ | |||
+ | < | ||
+ | # vi / | ||
+ | rsync : 127.0.0.1 : allow | ||
+ | rsync : 192.168.11. : allow | ||
+ | </ | ||
+ | |||
+ | === xinetd起動 === | ||
+ | |||
+ | < | ||
+ | # / | ||
+ | # chkconfig xinetd on | ||
+ | </ | ||
+ | |||
+ | === rsyncの設定ファイル === | ||
+ | |||
+ | <color red> | ||
+ | |||
+ | < | ||
+ | # cat / | ||
+ | log file=/ | ||
+ | secrets file=/ | ||
+ | hosts allow = 38.99.89.185/ | ||
+ | hosts deny = * | ||
+ | transfer logging = true | ||
+ | auth users = backup | ||
+ | list = true | ||
+ | uid = root | ||
+ | gid = root | ||
+ | |||
+ | [www] | ||
+ | comment = html contents | ||
+ | path = /var/www | ||
+ | </ | ||
+ | |||
+ | === secretsの用意 === | ||
+ | |||
+ | < | ||
+ | # cat / | ||
+ | backup: | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== rysncサーバ ポート変更 ==== | ||
+ | |||
+ | ポート変更する場合、xinetdでは上げられないのでrsyncデーモンだけで上げる。 | ||
+ | < | ||
+ | # rsync --daemon --config=/ | ||
+ | </ | ||
+ | |||
+ | ===== クライアント側(バックアップを取る側の用意) ===== | ||
+ | |||
+ | < | ||
+ | # cat / | ||
+ | xxbackup | ||
+ | </ | ||
+ | |||
+ | ==== コマンド ==== | ||
+ | |||
+ | < | ||
+ | # rsync -av --password-file=/ | ||
+ | </ | ||
+ | |||
+ | ==== クライアント側 ポート変更する場合 ==== | ||
+ | |||
+ | |||
+ | < | ||
+ | # rsync -av --port=10873 --password-file=/ | ||
+ | </ | ||
+ | ==== オプション ==== | ||
+ | |||
+ | [[02_freebsd: | ||
+ | |||
+ | {{tag> |