192.168.1.88 file/Web to 192.168.1.189/Web
========================== 192.168.1.88 ================================== ====================================
[[Email protected] # tar zxvf inotify-tools-3.14.tar.gz
[[Email protected] # cd inotify-tools-3.14
[[Email protected] inotify-tools-3.14] #./configure -- prefix =/usr/local/inotify-Tools
[[Email protected] inotify-tools-3.14] # Make & make install
VI/etc/rsyncd. Secrets
Root: 123
[[Email protected] ~] # Cat inotify. Sh
#! /Bin/bash
#
Host1 = 192.168.1.189 # Server IP Address
Src =/web/# local data storage directory
DST = web # server data directory
User = root # host a allows users to push and pull data
/Usr/local/inotify-tools/bin/inotifywait-mrq-e modify, delete, create, attrib $ SRC | while read line; do
/Usr/bin/rsync-vzrtopg -- delete -- Progress -- password-file =/etc/rsyncd. passwd $ SRC [email protected] $ HOST: $ DST
Done
[[Email protected] ~] # Vi inotify. Sh
[[Email protected] ~] #./Inotify. Sh
==================================== 192.168.1.189 ====================== ====================================
Yum install xinetd
Service xinetd start
Chkconfig rsync on
[[Email protected] # Cat/etc/rsyncd. conf
PID file =/var/run/rsyncd. PID
Port = 873
Uid = root
Gid = root
User chroot = Yes
Read Only = No
Write only = No
Hosts allow = 192.168.1.0/255.255.255.0
Host deny = *
Mac connections = 2
Log File =/var/log/rsync. Log
Log format = % T % A % m % F % B
Timeout = 300
[Web]
Path =/Web
List = Yes
Ignore Error
Auth user = root
Secrets file =/etc/rsyncd. Secrets
Exclude= 222/
VI/etc/rsyncd. Secrets
Root: 123
Rsync + inotify