Rsync + inotify

Source: Internet
Author: User
Tags inotify rsync

 


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.