Install rsync server in CentOS 6.6

Source: Internet
Author: User
Tags inotify

Install rsync server in CentOS 6.6

I. Introduction

Rsync is often used for code distribution or data backup at work. The configuration is not complex and only recorded. The installation environment is as follows:

1) CentOS6.6

2) rsync-3.0.6-12.el6.x86_64

3) Server IP: 192.168.19.128; Client IP: 192.168.19.145

Ii. Installation

$ Yum install-y rsync xinetd
$ Setenforce 0 or echo "SELINUX = disabled">/etc/selinux/config (it takes effect only after restart)

Ii. Configuration

$ Vi/etc/rsyncd. conf
Uid = root # transfer files with the specified UID
Gid = root # transfer a file with the specified GID
# Hosts allow = 10.50.53.100 # allow access from a specified host
# Hosts deny = 0.0.0.0/32 # block access from a specified host
Use chroot = yes
Max connections = 10 # maximum number of connections allowed
Pid file =/var/run/rsyncd. pid # specify the pid file path
Lock file =/var/run/rsync. lock # specifies the process lock file
Log file =/var/log/rsyncd. log # specify the log Path
Timeout = 600 # connection timeout
Port = 873 # specify the tcp port

[Backup]
Path =/data
Comment = rsync files
Read only = no

List = yes
Auth users = chicken00
Secrets file =/etc/. rsyncd. secrets

# Set the user name and password. The user name is the same as that specified in the configuration file (auth users)
$ Echo "chicken00: chicken00">/etc/. rsyncd. secrets

# File permissions must be set to 600
$ Chmod 600/etc/. rsyncd. secrets

3. Start

# Set to boot
$ Chkconfig rsync on

# Viewing startup
$ Chkconfig -- list rsync
Rsync on

# Content in xinetd configuration of rsync daemon
$ Cat/etc/xinetd. d/rsync
# Default: off
# Description: The rsync server is a good addition to an ftp server, as it \
# Allows crc checksumming etc.
Service rsync
{
Disable = no
Flags = IPv6
Socket_type = stream
Wait = no
User = root
Server =/usr/bin/rsync
Server_args = -- daemon
Log_on_failure + = USERID
}

# Start the service
$/Etc/init. d/xinetd start

Iv. Check

# Enable Firewall

V. Client synchronization test

$ Echo "chicken00">/etc/. rsyncd. secrets
$ Chmod 600/etc/. rsyncd. secrets
$ Echo 'Hello rsync !! '> Hello.txt

# Uploading files
$ Rsync-vzrtopg -- delete -- progress hello.txt [email protected]: backup -- password-file =/etc/. rsyncd. secrets

# Check whether the file is synchronized on the server.

# Download
$ Rsync-vzrtopg -- delete -- progress [email protected]: backup $ (pwd)/backup-$ (date + % Y-% m-% d) -- password-file =/etc /. rsyncd. secrets

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:

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.