Centos6.5 rsync Synchronous Backup

Source: Internet
Author: User
Tags rsync

This chapter mainly explains the realization of fast, safe and efficient offsite backup

Lab environment: Server-Side A 192.168.1.10 client B 192.168.1.20


One, install the rsync yum-y install rsync*

New configuration file vi/etc/rsyncd.conf

UID = nobody

GID = Nobody

Use chroot = yes

Address = 192.168.1.10

Port 873

Log file =/var/log/rsyncd.log

PID file =/var/run/rsyncd.pid

Hosts allow = 192.168.1.0/24

[YY]

Path =/var/www/html

Comment = CCCCCCCCCCCCC

Read Only = yes

Dont compress = *.gz *.bz2

Auth Users =bin

Secrets file =/etc/rsyncd_users.db

Note: If you are using anonymous synchronization, simply remove the Auth users and Secrets file configuration records.


Two, create the password Authentication file vi/etc/rsyncd_users.db


Bin:123

Save exit

Modify password file permissions chmod 600/etc/rsyncd_users.db


Third, start rsync rsync--daemon Ps-ef | grep rsync to view the process.

If you want to end the process, kill the process number.


1. Use rsync local backup to back up the file/etc/fastab to/tmp

rsync-rl/etc/fastab/tmp/


2, using the client with remote backup, first configure the server-side firewall iptables-i input-p TCP--dport 873-j ACCEPT

Service Iptables Save Firewall


Four, client Configuration

1. Create Test Catalog Mkdir/rsync

2. Synchronizing the Rsync shared directory

# rsync [Email protected]::yy//Browse Share

Vim/root/rsync_pass//Set Password file

123                                //just sign in User password, to match the server-side settings password

chmod 600/root/rsync_pass           //Do not modify permissions error

rsync-az--password-file=/root/rsync_pass [email protected]::yy/rsync //synchronous

3. Put rsync into crontab scheduled tasks, synchronize once a day

#crontab-e 
0 5 * * */usr/bin/rsync-a--password-file=/root/rsync_pass [Email protected]::yy  /rsy NC



This article is from the "12227329" blog, please be sure to keep this source http://zhangbin666.blog.51cto.com/12227329/1867605

Centos6.5 rsync Synchronous Backup

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.