Cwrsync is divided into the client and the server side, the server for the file is the same misconduct, a port default is 873; The client is to actively synchronize the file to one end of the machine, does not start the port, when the file synchronization, will actively connect to the server port 873. The topology diagram is probably as follows:
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/99/5D/wKioL1lHlITRe2aFAAAOrjsEi9Y570.png "title=" 14. PNG "alt=" Wkiol1lhlitre2afaaaorjsei9y570.png "/>
The installer shows:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/99/5D/wKiom1lHlMqAofLQAAAJiPcuL9Q538.png "title=" 15. PNG "alt=" Wkiom1lhlmqaoflqaaajipcul9q538.png "/> the installer has been uploaded by Csdn resource, and the following is the connection.
Cwrsyncserver_4.0.5_installer.zipCwrsync_client_4.0.5_installer.zip
Installation:
Install Server side:
On the server side, upload the following steps after the decompression:
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/99/5E/wKiom1lHmUyC0h07AAArs3c2Hu0353.png "style=" float : none; "title=" 1.png "alt=" Wkiom1lhmuyc0h07aaars3c2hu0353.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/99/5E/wKioL1lHmU2Sb1pMAAApzL_nII8433.png "style=" float : none; "title=" 2.png "alt=" Wkiol1lhmu2sb1pmaaapzl_nii8433.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M01/99/5E/wKiom1lHmU2Ap4hRAAAjX4Yo4uw776.png "style=" float : none; "title=" 3.png "alt=" Wkiom1lhmu2ap4hraaajx4yo4uw776.png "/>
The user name and password can be set manually or by default. It is said that this account and password is more important, but the application behind me is not used. On the network, if the account password is changed, the account and password should be changed in the service, otherwise it won't start up.
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/99/5E/wKioL1lHmU6ynRgEAAAomGuvw1I019.png "style=" float : none; "title=" 4.png "alt=" Wkiol1lhmu6ynrgeaaaomguvw1i019.png "/>
installation process
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/99/5E/wKiom1lHmU-SGnbVAABHW1Lpg7Y371.png "style=" float : none; "title=" 5.png "alt=" Wkiom1lhmu-sgnbvaabhw1lpg7y371.png "/>
When the installation is complete, click Close
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/99/5E/wKiom1lHmU-iAyeGAAAa5mi-yEA941.png "style=" float : none; "title=" 6.png "alt=" Wkiom1lhmu-iayegaaaa5mi-yea941.png "/>
After the installation is complete, there is a rsync.conf file in the installation directory, CP a copy of this file as a backup, and then modify the configuration file.
The contents of the file are as follows:
To say this, in the path path setting, if you want to represent the c:\a\b\c directory, then the way to write is/cygwin/c/a/b/c
For the sake of security I am here to sync the settings of the account and password, auth users = Xinsir, indicating synchronization using Xinsir account for synchronization;
Sercets file = xxxxxx/rsync.passwd This specified user password files path, password file contents: " Account: Password "
Use chroot = falsestrict modes = falsehosts Allow = *log File = rsyncd.logpid File = Rsyncd.pid Port = 8173uid = 0gid = 0m AX connections = 10# Module definitions# Remember Cygwin naming conventions:c:\work Becomes/cygwin/c/work#[config]path =/cygdrive/d/autobackupread only = falsetransfer logging = Yeslock File = Rsyncd.lockauth users = xinsirsecrets file =/C ygdrive/e/pass/rsync.passwd
After modifying the configuration file, you need to restart the Sync service and go to the computer-management-service to restart the service.
To install the client:
Client installation After first downloading the installer, all installation steps are default, and after the installation is completed, the following files are generated in the directory:
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/99/5E/wKioL1lHnKnSVM_GAAA7TG0HdbM607.png "title=" 16. PNG "alt=" Wkiol1lhnknsvm_gaaa7tg0hdbm607.png "/>
To perform a synchronous test:
Write a synchronized batch file with the following file contents:
The server side does not have a password set for this write:
@echo off #没有密码set rsync_home=c:\program files\cwrsync\bincd%rsync_home%rsync-av rsync://192.168.2.242/test/ Cygdrive/e/test
The server side has the setting password for this write:
@echo off #需要密码set rsync_home=c:\program files\cwrsync\bincd%rsync_home%rsync-avzp--progress--delete-- password-file=/cygdrive/c/pass/rsync.passwd [Email protected].2.242::test/cygdrive/e/test
This means that the E:\bak directory under the test module under 192.168.2.242 is synchronized to the client's e:\test
Parameter description:
-avzp
-a parameter, equivalent to-rlptgod,-r is the recursive-L is a linked file, which means to copy the link file;-p to maintain the original file permissions;-T to keep the file original user group;-O Keep the original owner of the file;-D is equivalent to the block device file;
-Z compression during transmission;
-P Transfer Progress
-v verbose, verbose mode output
-U is to synchronize only the files that have been updated, to prevent files that are not updated from being updated again, but be aware of the synchronization of the two machine clocks
--progress
Show backup process
--delete
Delete files that do not have SRC in DST
--password-file
Specify the password file, just include the password without the user name
[Email Protected]::test
Svccwrsync Login server-side user name
192.168.2.242 IP address on server side
Test server-side specified authentication module name, multiple synchronization jobs by this module name distinguish
/cygdrive/e/test
Local directory where server-side synchronization files are stored
Attention:
It is important to generate a password file, if you use the Xinsir account for synchronization, then create a Xinsir account on the client machine, with Xinsir login to the host, create a sync.passwd file, the file is only write password The rest of Nothing is written, right-click the file in the Security tab in the properties of the owner in the advanced, if the critical owner is Xinsir, if not please change if it is complete. Such as:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/99/5F/wKiom1lHoCqwwqhBAAAiZA8AuoM703.png "style=" float : none; "title=" 17.png "alt=" Wkiom1lhocqwwqhbaaaiza8auom703.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/99/5F/wKioL1lHoCrC7I7AAAAho6F6xu4777.png "style=" float : none; "title=" 18.png "alt=" Wkiol1lhocrc7i7aaaaho6f6xu4777.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/99/5F/wKiom1lHoCuhFAGvAAAjSQZaWsI875.png "style=" float : none; "title=" 19.png "alt=" Wkiom1lhocuhfagvaaajsqzawsi875.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/99/5F/wKioL1lHoCuCJWgNAAAuJsWzolI510.png "style=" float : none; "title=" 20.png "alt=" Wkiol1lhocucjwgnaaaujswzoli510.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/99/5F/wKiom1lHoCuS3apUAAAk4n6srL8997.png "style=" float : none; "title=" 21.png "alt=" Wkiom1lhocus3apuaaak4n6srl8997.png "/>
Double-click on the written batch process to verify that the files are synced successfully!
This article is from the "Learning to change the Destiny" blog, please make sure to keep this source http://xinsir.blog.51cto.com/5038915/1939962
Cwrsync to implement scheduled synchronization of files under Windows (SQL Server 2008R2 backup file timing synchronization)