Sshd+rsync to realize the principle of data synchronization is simple
The client connects to the server through SSHD, and the server synchronizes the data to the client
First look at the server's kernel information
Server Side
[Root@server ~]# Uname-a
Linux server.test.com 2.6.18-194.el5 #1 SMP Tue 21:52:43 EDT i686 i686 i386 gnu/linux
Client Side
[Root@client ~]# Uname-a
Linux client.test.com 2.6.18-194.el5 #1 SMP Tue 21:52:43 EDT i686 i686 i386 gnu/linux
First, both the client and the server need to configure the Yum source, where I use the local Yum source
Installing rsync and XINETD Services
[Root@server ~]# yum Install rsync xinetd-y
[Root@client ~]# yum Install rsync xinetd-y
Modify/etc/xinetd/
[Root@server ~]# Vi/etc/xinetd.d/rsync
Change Disable=yes to Disable=no
and restart the XINETD service.
[Root@server ~]#/etc/init.d/xinetd Restart
stopping xinetd: [OK]
Starting xinetd: [OK]
The client server does the same operation
Client and server-side SSH services are turned on
[Root@server ~]#/etc/init.d/sshd Restart
stopping sshd: [OK]
Starting sshd: [OK]
On the server
[Root@server/]# Mkdir/data
[Root@server/]# Cd/data
[Root@server data]# mkdir Server
[Root@server data]# CD server/
[Root@server server]# pwd
/data/server
[Root@server server]# Du-sh Test.rar
249M Test.rar
uploaded a file in the server Test.rar
Then create a new file
[Root@server server]# Touch TT
[Root@server server]# ls
Test.rar TT