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