Windows also has a similar to the UNIX under the Rsync software, recently I tried the Cwrsync software, the configuration and use of the method introduced, it is really easier to use it.
Sync rsync Server software download Cwrsync_server_2.0.10_installer.zip
Sync rsync Client software download Cwrsync_client_2.0.10_installer.zip
After installing the Sync rsync Server Software cwrsync_server_2.0.10_installer on a Windows server that requires a synchronization file to be sent,
An administrator-level Svcwrsync user will be built on the server, and we'd better change the user's password.
On this server also added a rsyncserver service, if not set to start automatically, need to set up, the following figure.
Then set the environment variables on the Windows Server with the Sync rsync server and rsync client software installed:
Add the directory C:/Program Files/cwrsyncserver/bin to the current user's path.
The general format of the configuration file rsyncd.conf on the synchronization rsync server is similar:
###############################################################
Use Chroot = False
Strict modes = False
#hosts allow = 192.168.0.2
Hosts allow = *
Log file = Rsyncd.log
PID file = Rsyncd.pid
Secrets file = password
# Module Definitions
# Remember Cygwin naming conventions:c:/work becomes/cygwin/c/work
#
[Dbbackup]
Path =/cygdrive/d/sqlserver_backup
Read Only = True
List = no
Auth users = Fengyu
Transfer logging = yes
[Test]
Path =/cygdrive/d/ying
Read Only = True
List = no
Auth users = Ying
Transfer logging = yes
###############################################################
In the C:/Program files/cwrsyncserver/directory of rsync server password The contents of the password file are as follows:
Fengyu:dbbackup_test
ying:maggie678
This user name and password can be set arbitrarily, with Windwos and UNIX account has no relationship. Remember to use colon: Split user name and password
Write a batch program on the Rsync client side that contains the rsync command Rsync_test.bat
RSYNC-VZRTOPG--progress--delete--password-file=/cygdrive/f/fengyu/password2 fengyu@192.168.0.10::d bbackup/ Cygdrive/f/fengyu/dbbackup_test
Please note that the password dbbackup_test is only required in the F:/fengyu/password2 file of the Rsync client-side Windows Server, as follows:
Dbbackup_test
Of course, you can also use a similar method on Unix machines to get synchronized folders that are set up in the Windows Server rsync server configuration file
RSYNC-VZRTOPG--progress--delete--password-file=/home/ying/ying_passwd ying@192.168.0.10::test/home/ying/ying_ Test
Password/home/ying/ying_passwd file also only need to fill in maggie678, as follows:
maggie678
If you want synchronization to work, you can set up a task schedule on a Windows server and configure a cron job on a UNIX machine.
Finally, the Administrator periodically views the synchronization log files on the rsync server C:/Program Files/cwrsyncserver/rsyncd.log
You know if the sync is working properly.