The realization of the directory synchronization function of the Linux rsync website

Source: Internet
Author: User

Achieve the goal:

The/var/www/sw_service directory on the 172.16.1.64 server is synchronized with the/var/www/sw_service directory on the 172.16.1.60 server,

i.e. 1.60 Active to 1.64 sync

Environment configuration:

Server-->172.16.1.64/var/www/sw_service

Client-->172.16.1.60/var/www/sw_service

Application Deployment:

First, server segment configuration

1, rsync system comes with, need to use--deamon way to start, the service port is TCP 873

2, Vim/etc/xinetd.d/rsync modified disable =yes for disable =no, the modified file as follows

3,/etc/init.d/xinetd restart restart xinted service

4. Edit the main configuration file 1122.www.qixoo.qixoo.com/etc/rsyncd.conf This file needs to be created by itself

5. Edit the server's password file/etc/backup.pass

6, chmod 600/etc/backup.pass

Second, the client configuration is as follows

1. Edit the password file of rsync connection/etc/rsync_client.pass

2, chmod 600/etc/rsync_client.pass

3. Use the rsync command to connect to the server for file synchronization

The server-side file has not changed since it was previously synchronized, so it is out of sync.

4. Write Synchronization scripts

5, add to the scheduled task crontab

* * * * */root/.web_rsync.sh >/dev/null 2>&1

6. Restart the Crond service


The entire configuration is complete.

This article is from the "" blog, please make sure to keep this source

The realization of the directory synchronization function of the Linux rsync website

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.