rsync Sync Data under CentOS

Source: Internet
Author: User

1. Install rsync

Yum-y Installrsync

2, no password command line synchronization

Client actions

Ssh-keygen-trsa

Ssh-copy-id-i/root/.ssh/[email protected]

SSH [email protected]

Mkdir-pv/data/shell

rsync-az--delete [Email protected]:/data/rsyncdata//data/shell/

3. synchronization with password service mode

because rsync belongs to the XINETD service, you need to install XINETD first

Yum-y installxinetd

Vi/etc/xinetd.d/rsync

change distable to No

Start the service

/etc/init.d/xinetdstart

NETSTAT-TUNPL |grep 873

Create user

Useraddrsyncuser

Echo ' 123456 ' |passwd--stdin rsyncuser

Create a backup directory

Mkdir-pv/data/rsyncdata

Setting up a configuration file

Vi/etc/rsyncd.conf

Uid=nobody

Gid=nobody

address=192.168.1.181

port=873

hostsallow=192.168.1.186

Use Chroot=yes

Maxconnections=5

Pidfile=/var/run/rsyncd.pid

Lockfile=/var/run/rsync.lock

Log File=/var/log/rsyncd.log

Motdfile=/etc/rsyncd.motd

[Backdata]

Path=/data/rsyncdata

Comment=rsyncbackup

Read Only=yes

List=yes

Authusers=rsyncuser

secretsfile=/etc/rsyncd.passwd

Create a reminder file and password file

Echo ' Welcome Tobackup server ' >/ETC/RSYNCD.MOTD

vi/etc/rsyncd.passwd

rsyncuser:123456

chmod 600/etc/rsyncd.passwd

Service Xinetdrestart

Client No Password Synchronization

exportrsync_password=123456

rsync [Email protected]::backdata/data/shell/


This article is from the "track to record work learning" blog, so be sure to keep this source http://stephenliu.blog.51cto.com/6470474/1676556

rsync Sync Data under CentOS

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.