Rsync +inodify for file synchronization

Source: Internet
Author: User
Tags rsync

My configuration:

A is the service side

B is client

For A and B configuration please refer to Rsync+ssh

Because Rsync uses SSH channels, the service side of rsync is not required to be configured or started, and Rsync uses the port where SSH is in transit.

I wrote the script on the A end.

#! /bin/bash

host1=192.168.2.81

Src=/data/crash

St1=/data/crash

User=root

/usr/local/bin/inotifywait-mrq--timefmt '%d/%m/%y%h:%m '--format '%T%w%f%e '-e modify,delete,create,attrib $src \

| While read files

Do

/USR/BIN/RSYNC-VZRTOPG--delete--progress $src-e ssh [email protected] $host 1: $DST 1

echo "${files} was rsynced"

Done


Function: Synchronizes the files under the end of a/data/crash to the 192.168.2.81/data/crash


This article is from the "is Wayward" blog, please be sure to keep this source http://9756063.blog.51cto.com/9746063/1604097

Rsync +inodify for file synchronization

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.