The
Cwrsync is an rsync software package based on the Cygwin platform that supports Windows efficient file synchronization for Windows, Windows, Linux, and Linux for Windows. Since Cwrsync has integrated the Cygwin class library, it is possible to save Cygwin packages when installing. Cwrsync also integrates openssh for Windows to achieve exactly the same things as Rsync under Linux. Detailed configuration steps are as follows:
One, server-side installation configuration
1, download server-side installation files http://http://www.jb51.net/softs/55933. HTML is due for this document update date, the latest version is Cwrsync_server_4.0.2_installer
2, installation
This step is important, can be said to be the key to the success of Cwrsync installation. This step requires that you enter the account password that exists for the current system to start the Rsyncserver service, which needs to be set up before installation because the installer is not created automatically. If this account is not created in advance or if the password is too long, the "rsyncserver" service will not appear in the system "services". Recommended password length within 12. The
program automatically sets the permissions that the program directory can modify because log files need to be written.
3, modify configuration file rsyncd.conf
Use Chroot = False
Strict modes = False
Log file = Rsyncd.log
# Module Definitions
# Remember Cygwin naming conventions:c:\work becomes/cygwin/c/work
#
[rsync] Path =/cygdrive/d/file
Read Only = False
Transfer logging = yes
Ignore errors
List = no
Hosts allow = 192.168.101.63
Hosts deny = *
Auth users = Svccwrsync
Secrets file =/cygdrive/d/pass/rsync.passwd
The configuration file is in the root directory of the installer, and the configuration is as follows, and the parameter explains:
Use chroot = no # chroot not used
Strict modes = False #使用静态模式
PID file =/var/run/rsyncd.pid
Log file =/var/log/rsyncd.log # logging Files
[Rsync] # Here is the Certified module name, which needs to be specified on the client side
Path =/cygdrive/d/file # need to do a mirrored directory, such as D:/file
Transfer logging = yes # record transfer log
Ignore errors # can ignore some irrelevant IO errors
Read Only = yes # reading only
List = no # does not allow column files
Hosts allow=192.168.1.0/255.255.255.0
Hosts deny = * Prohibit connection IP except 192.168.1.0/255.255.255.0 segment
Auth users = svccwrsync # authenticated username, if not, indicates anonymous
Secrets file =/cygdrive/d/pass/rsync.passwd # Certified file name
Create the authentication file D/PASS/RSYNC.PASSWD content format: User: password, such as svccwrsync:347sjdg345876y8324, start rsyncserver service and ensure the power-on automatically restart, Ensure that the Rsyncserver service team certification file read-only property, server-side configuration completed.
Second, the client installs the configuration
1, download the client installation package http://www.jb51.net/softs/55934.html due to this document update date, the latest version is Cwrsync_4.0.2_installer
2, installation
Click Install, install complete.
3, Cwrsync client does not require a very complex configuration, only the command line to synchronize server-side Data batch script Rsync.bat content is as follows:
@echo off set Rsync_home=d:\program files\cwrsync\bin cd%rsync_home% d:rsync-avzp--progress--delete--password-file=/ CYGDRIVE/D/PASS/RSYNC.PASSWD Svccwrsync@192.168.101.62::rsync/cygdrive/d/file
Command parameter explanation:
- a VZ P
-A parameters, equivalent to -rlptgod,-R is recursive- l is a linked file, meaning copy linked file;-p to maintain the original permissions of the file;t maintain the original time of the file,G to maintain the original user group,-o to maintain the original owner of the file,-D equivalent to block device files;
- Z compression during transmission;
- P transmission progress;
- v Verbose , verbose mode output
- u is to synchronize only the files that have been updated, to avoid files that are not updated again, but to be aware of the synchronization of the Machine clocks
--progress
Show backup process
--delete
Delete files in DST that are not in SRC
--password-file
Specify a password file that contains only the password without the user name
svccwrsync@192. 168.101.62::rsync
Svccwrsync Login server-side user name
192.168.101.62 server-side IP address
rsync server-side specified authentication module name, multiple synchronization jobs are distinguished by this module name
/cygdrive/d/file
Local directory where server-side sync files are stored
4 , Configure the system job, run the script to select Rsync.bat, and the client configuration is complete.