Cross-server/client BACKUP command: rsync usage

Source: Internet
Author: User
Tags inotify connection reset rsync usage

Cross-server/client BACKUP command: rsync usage

Recently, we often need to deploy environments on a new server. Many things can be backed up directly from other servers without re-downloading and installing them.

The rsync command is used: first download rsync and install it on the "source server". For details about the process, refer to the connection at the end of this article.

Then configure the rsync. conf file in the "source server", which is usually in/etc/rsyncd. conf.

Add the following statement to the file:

Path =/data1/liujian/
Uid = root
Gid = root
Read only = no
Hosts allow = *****/

Save and run the command: usr/bin/rsync -- daemon -- config =/etc/rsyncd. conf

Then run the following command on the target server: rsync-avzP root @**. **. **. **: liujian/data1/liujian/test/(where ****** is the "source server" IP address)

If there is no problem, the progress bar will be displayed.

Clarify the rsync Error Report

Rsync configure:

Configuration 1:

Ignore errors

Note: It is best to add this option. Otherwise, errors often occur in many crontab tasks, which you cannot see every day, the probability of this error is relatively high, because the disk IO is a bottleneck for any large project or system.

Rsync error:
Error 1:
@ ERROR: auth failed on module xxxxx
Rsync: connection unexpectedly closed (90 bytes read so far)
Rsync error: error in rsync protocol data stream (code 12) at I/O. c (150)
Note: this is because the password is set incorrectly and cannot be successfully logged in. Check rsync. pwd to see if the customer service matches. This also happens when the rsync service is not started on the server.

Error 2:
Password file must not be other-accessible
Continuing without password file
Note: this is because rsyncd. pwd rsyncd. sec has incorrect permissions and should be set to 600. Example: chmod 600 rsyncd. pwd

Error 3:
@ ERROR: chroot failed
Rsync: connection unexpectedly closed (75 bytes read so far)
Rsync error: error in rsync protocol data stream (code 12) at I/O. c (150)
Note: this is because the path you set in rsync. conf does not exist. You need to create a new directory to enable synchronization.

Error 4:
Rsync: failed to connect to No route to host (113)
Rsync error: error in socket IO (code 10) at clientserver. c (104) [handler ER = 2.6.9]
Note: As a result of a firewall problem, it is best to completely shut down the firewall first. This is the basic principle for troubleshooting. problems such as S, C, and ignore errors can also result in problems.

Error 5:

@ ERROR: access denied to www from unknown (
Rsync: connection unexpectedly closed (0 bytes encoded Ed so far) [Cycler]
Rsync error: error in rsync protocol data stream (code 12) at I/O. c (359)

Note: This problem is obvious. It is the problem of configuring the host allow option. beginners like to configure a allowed segment, and the module is the same, resulting in

Error 6:

Rsync error: lost Ed SIGINT, SIGTERM, or SIGHUP (code 20) at rsync. c (244) [generator = 2.6.9]
Rsync error: lost Ed SIGUSR1 (code 19) at main. c (1182) [author ER = 2.6.9]

Note: Most of the reasons for this problem are that the server service is not started properly. Go to the server and check whether the service is started. Then, check/var/run/rsync. if the pid file exists, the simplest way is to kill the started service, then start the service again, or add the script to the system startup service level, and then shutdown the-r now server.

Error 7:

Rsync: read error: Connection reset by peers (104)
Rsync error: error in rsync protocol data stream (code 12) at io. c (604) [sender = 2.6.9]

Note: No data exists in the original data directory.

RSync for file backup Synchronization

Monitor host files and directories using inotifywait

Using inotify + rsync for Linux File batch update

Inotify-tools + rsync real-time file synchronization installation and configuration

Complete rsync synchronization Configuration

Remote synchronization of Rsync in CentOS 6.5

Rsync details: click here
Rsync: click here

This article permanently updates the link address:

Related Article

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: 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.