Achieve the goal:
the /var/www/sw_service directory on the 172.16.1.64 server is synchronized with the/var/www/sw_service directory on the 172.16.1.60 server,
i.e. 1.60 Active to 1.64 sync
Environment configuration:
server-->172.16.1.64 /var/www/sw_service
client-->172.16.1.60 /var/www/sw_service
Application Deployment:
First, server segment configuration
1,rsync system comes with, need to use--deamon way to start, service port is TCP 873
2. Vim /etc/xinetd.d/rsync Modify Disable =yes to disable =no, the modified file is as follows
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/6B/wKiom1Yco6jSLfJfAAHOvrjzX5w102.jpg "title=" 1.png " alt= "Wkiom1yco6jslfjfaahovrjzx5w102.jpg"/>3,/etc/init.d/xinetd Restart restart xinted service
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/67/wKioL1YcpA6igtQyAACJdbi2hkQ680.jpg "title=" 2.jpg " alt= "Wkiol1ycpa6igtqyaacjdbi2hkq680.jpg"/>
4. Edit the primary profile/etc/rsyncd.conf this file needs to be created by itself
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/74/6B/wKiom1YcpBSAz-_BAAF5A9Wjmj4155.jpg "title=" 3.jpg " alt= "Wkiom1ycpbsaz-_baaf5a9wjmj4155.jpg"/>
5. Edit the password file for the server/etc/backup.pass
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/6B/wKiom1YcpDyTgew7AABGkbBjpus280.jpg "title=" 4.jpg " alt= "Wkiom1ycpdytgew7aabgkbbjpus280.jpg"/>
6. chmod 600/etc/backup.pass
Second, the client configuration is as follows
1. Edit the password file for rsync connection/etc/rsync_client.pass
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/67/wKioL1YcpJvjxQQXAABBPW_3Hx0335.jpg "title=" 5.jpg " alt= "Wkiol1ycpjvjxqqxaabbpw_3hx0335.jpg"/>
2. chmod 600/etc/rsync_client.pass
3. Use the rsync command to connect to a server for file synchronization
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/6B/wKiom1YcpKngvWVmAAERPvJ-bzw381.jpg "title=" 6.jpg " alt= "Wkiom1ycpkngvwvmaaerpvj-bzw381.jpg"/>
The server-side file has not changed since it was previously synchronized, so it is out of sync.
4. Write Synchronization scripts
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/6B/wKiom1YcpNOBb4v4AAEGtZa_tWY393.jpg "title=" 7.jpg " alt= "Wkiom1ycpnobb4v4aaegtza_twy393.jpg"/>
5, add to the scheduled task crontab
* * * * */root/.web_rsync.sh >/dev/null 2>&1
6. Restart Crond Service
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/67/wKioL1YcpRuz4AEaAABucUPlUfY087.jpg "title=" 8.jpg " alt= "Wkiol1ycpruz4aeaaabucuplufy087.jpg"/>
The entire configuration is complete.
This article is from the "Water Lions," blog, please be sure to keep this source http://darren88.blog.51cto.com/4779311/1702510
The realization of the directory synchronization function of the Linux rsync website