1. Windows to Windows
1.1. Required Software: Cwrsyncserver_4.1.0_installer.zip
1.2. Installation:
After decompression, directly double-click the installation
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/90/wKioL1V_64yhBrOLAAGHrnkgvdw490.jpg "style=" float: none; "title=" 1.png "alt=" Wkiol1v_64yhbrolaaghrnkgvdw490.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/90/wKioL1V_64yR7c3xAAGf_s_5sc0541.jpg "style=" float: none; "title=" 2.png "alt=" Wkiol1v_64yr7c3xaagf_s_5sc0541.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/94/wKiom1V_6d7iLL7mAAFXL1mtUMY587.jpg "style=" float: none; "title=" 3.png "alt=" Wkiom1v_6d7ill7maafxl1mtumy587.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/90/wKioL1V_64zAQqbjAAGUTCJcttw597.jpg "style=" float: none; "title=" 4.png "alt=" Wkiol1v_64zaqqbjaagutcjcttw597.jpg "/>
This step is to set up the account and password for synchronization, which creates a user at the operating system level: Svccwrsync. Of course, we can also modify the user, set their own password, all can.
But Windows can not be set, all by default.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/94/wKiom1V_6d6Si1FOAADQ8b1bXNQ443.jpg "style=" float: none; "title=" 5.png "alt=" Wkiom1v_6d6si1foaadq8b1bxnq443.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/90/wKioL1V_643iorygAAH3dLsRwEI050.jpg "style=" float: none; "title=" 6.png "alt=" Wkiol1v_643iorygaah3dlsrwei050.jpg "/>
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/94/wKiom1V_6d-QTiAnAATE_JL3Y8g685.jpg "style=" float: none; "title=" 7.png "alt=" Wkiom1v_6d-qtianaate_jl3y8g685.jpg "/>
1.3. Configure the service side
Edit file: rsyncd.conf
Use chroot = falsestrict modes = falsehosts Allow = *log file = rsyncd.log# Module definitions# Remember cygwin naming con Ventions:c:\work Becomes/cygwin/c/work#[testapp]path =/cygdrive/d/testapphosts allow = 192.168.XX. Xxxhosts deny = *read only = falsetransfer logging = Yeslock File = rsyncd.locklist = Trueuid = 0gid = 0
1.4. Configure client Synchronization
The following command, written as a bat script, is added to the scheduled task and executed at timed intervals.
Rsync-avzp--progress--delete 192.168.2.86::testapp/cygdrive/d/testapp
2. Windows to Linux
2.1. Required Software:
1) cwrsyncserver (installed under Windows) 2) RSYNCD
Official address: http://rsync.samba.org/ftp/rsync/
Direct download: wget http://rsync.samba.org/ftp/rsync/rsync-3.0.9.tar.gz
2.2. Software Installation
Windows installed under the same top 1.2, configuration see above 1.3
Installing rsync under Linux can use the Yum tool, or you can manually edit the installation yourself;
The following describes their own manual compilation installation method;
2.3, under Linux Installing Rsync
TAR-ZXVF rsync-3.0.9.tar.gzcd rsync-3.0.9./configuremake && make install
2.4. Configure client Synchronization
#!/bin/sh/usr/bin/rsync-vzrtopg--delete--progress 192.168.1.10::attachments/data/webbak/
3. Linux to Linux
3.1, Linux under Rsync installation See 2.2, 2.3
3.2. rsync server configuration under Linux
1) Configure the server side
Vi/etc/rsyncd.confuid = Rootgid = RootUse chroot = Nomax Connections = 20pid File =/var/run/rsyncd.pidlock File =/var/r Un/rsync.locklog file =/var/log/rsyncd.log[www]path =/data/wwwroot/wwwignore Errorsread only = nohosts allow = 192.168.1 .0/24hosts deny = 0.0.0.0/32
2) service-side start-up
/usr/bin/rsync--daemonecho "/usr/bin/rsync--daemon" >>/etc/rc.local
3) Configuring the Client
#!/bin/sh/usr/bin/rsync-vzrtopg--delete--progress 192.168.1.10::attachments/data/webbak/
FAQ One: Windows sync to Linux is garbled
Workaround:
1) When synchronizing files from Windows to Linux, you must add the following line to the Windows-side rsync configuration file:
CharSet = GBK
Under Linux, use the following command to synchronize files:
Rsync-avzup--progress --iconv=utf-8,gbk --protect-args--password-file=/etc/rsync.pass [email protected]:: Module/local/path
Note:--ICONV=UTF-8,GBK UTF-8 refers to the Linux local encoding, GBK refers to the server-side encoding of windows
2) When you sync files from Linux to Windows, turn the code around.
FAQ Two:
Continuous update ...
This article is from the "Cold Tea" blog, please be sure to keep this source http://miaocbin.blog.51cto.com/689091/1662461
Linux&&windows file synchronization Simple configuration [rsync]