Linux rsync Sync Installation tutorial

Source: Internet
Author: User
Tags chmod rsync


Rsync is a data mirroring Backup tool under Unix-like systems--remote sync. is a fast incremental backup tool remote Sync, which supports local replication or synchronizes with other SSH and rsync hosts.

By building rsync server and client, it is easy to solve the problem of file synchronization in the test environment and production environment, and the synchronization process is completely automated, which avoids the error transmission or leakage phenomenon of manual uploading files.

Now let's look at the setup process together.

Production environment host (rsync service side) settings

1. Configure rsyncd.conf Files

Vi/etc/rsyncd.conf

The settings are as follows:

[web]
Uid=www
Gid=www
Auth users = Web
Secrets file =/etc/rsyncd.pass
Path =/home/htdocs/web

2. Set Access password


Vi/etc/rsyncd.pass

The settings are as follows:

web:123456

Access password line corresponds to a user, in the form of user name: password

3. Change the permissions of the password file

chmod 600/etc/rsyncd.pass

Test environment Host (rsync client) configuration

1. Set Access password

Vi/etc/rsync/web.pas

The settings are as follows:

123456

The name of the password file for the Rsync client is the same as the user name

2. Change the permissions of the password file

chmod 600/etc/rsync/web.pas

3. To set the synchronization time to ignore the file


Vi/etc/rsync/exclude_web.conf


The contents of the exclude_web.conf file are as follows:


. SVN
. log
. ini
After the Rsync server and client settings are set, you can test the success of the settings on the client by executing the following command:


Rsync-avz--chmod=u=rwx,g=rx,o=r--progress--exclude-from=/etc/rsync/exclude_web.conf--password-file=/etc/rsync/ web.pas/home/htdocs/web/web@192.168.0.1::web/

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.