Windows Rsync synchronization Detailed deployment---Lao Cheng

Source: Internet
Author: User
Tags rsync

generally yes, yes Client from Server pull the data up, thousand don't do the reverse

all documentation and installation software is the inside the cloud disk

Http://yunpan.cn/cLEZcDtrUBZBN Access Password 6496

I. server -side installation

1. First create a user, this user is only used to start the rsync service to use

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/76/28/wKioL1ZMIcGhm755AABNjy55SkQ469.png "style=" float: none; "title=" 1.png "alt=" Wkiol1zmicghm755aabnjy55skq469.png "/>


2. Specify the new directory rsync-server

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/76/28/wKioL1ZMIcKRArsxAABcPBmID-4426.png "style=" float: none; "title=" 2.png "alt=" Wkiol1zmickrarsxaabcpbmid-4426.png "/>


3. Specify user name and password

the username and password are the user names created in the first step to start the rsync service.

The password is also, don't get it wrong.


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/76/2B/wKiom1ZMIdWgQi_iAABk7h5zmGw911.png "style=" float: none; "title=" 1.png "alt=" Wkiom1zmidwgqi_iaabk7h5zmgw911.png "/>


4. End of installation

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/76/2B/wKiom1ZMIdWC-lhZAABKSteN8pk754.png "style=" float: none; "title=" 2.png "alt=" Wkiom1zmidwc-lhzaabksten8pk754.png "/>


5. view the generated directory

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/76/28/wKioL1ZMIpTBPn9QAAA5gaZI9EA089.png "title=" 2.png " alt= "Wkiol1zmiptbpn9qaaa5gazi9ea089.png"/>


6. Create a directory user to hold the user name and password and set permissions

Create a passwd directory

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/76/28/wKioL1ZMIx3wr0vmAAB7mIHF7O4849.png "title=" 1.png " alt= "Wkiol1zmix3wr0vmaab7mihf7o4849.png"/>


The above hints do not affect


650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/76/2B/wKiom1ZMIy2gyNXpAADSOqQS31A173.png "title=" 2.png " alt= "Wkiom1zmiy2gynxpaadsoqqs31a173.png"/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/76/29/wKioL1ZMI6qhCqWBAADiC_KebfU580.png "title=" 1.png " alt= "Wkiol1zmi6qhcqwbaadic_kebfu580.png"/>


all of the above figures mean to set the owner of the passwd as Rsync


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/76/29/wKioL1ZMJZuCHDQeAABhzvIW-9c045.png "title=" 1.png " alt= "Wkiol1zmjzuchdqeaabhzviw-9c045.png"/>

7. Configure rsyncd.conf

usechroot = false   //do not use chroot  general intranet does not matter. uid =0   //  here by default, if changed, there will be a invalid uid  error gid =0     //here by default, if changed, there will be invaliduid  error strictmodes = false  //use static mode logfile =  rsyncd.log     //log   Not specified is in the rsync installation directory port= 20790    // Default 873  suggest change   here to 20790[pic]   //  define module name   Convenient client pull here to set min picpath= /cygdrive/d/ data_bak/iis_bak/api   //Here is important, this is the server end distribution to the client side of the data directory readonly = false    //only Read transferlogging = yesauthusers = admin     // This user is the user in passwd.conf secretsfile = /cygdrive/c/rsync-server/icw/passwd/passwd.conf  //   Specify the user login password file, where the user refers to the client's user hostsallow = *.*.*.*,*.*.*.*  //multiple IPs separated by commas hostsdeny =  0.0.0.0/0 

Path =/cygdrive/d/data_bak/iis_bak/api

POSIX style of writing

It's important to note that you can't write Windows style, or it will be an error, the beginning is /cygdrive The following is the path, and is / this / is a Linux style and not Windows style of


8. Configuration of login password

The front is the username admin separated by a colon followed by a password

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/76/2B/wKiom1ZMJcmQp_SOAAA5x1VKXfM621.png "title=" 1.png " alt= "Wkiom1zmjcmqp_soaaa5x1vkxfm621.png"/>


9. start the rsync service

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/76/2C/wKiom1ZMJeGwGCgPAAAfPyGfq64984.png "title=" 2.png " alt= "Wkiom1zmjegwgcgpaaafpygfq64984.png"/>


Service-Side testing

For example, display success

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/76/29/wKioL1ZMJk_SZi0GAAAVbpbcMd4103.png "title=" 3.png " alt= "Wkiol1zmjk_szi0gaaavbpbcmd4103.png"/>



two.installation of the client

Fool-Type Installation

    1. The first step

      650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/76/29/wKioL1ZMJ1OjNZd_AABxafrR8mE039.png "title=" 1.png " alt= "Wkiol1zmj1ojnzd_aabxafrr8me039.png"/>

2. Step Two

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/76/29/wKioL1ZMJ2WgvdZKAACOU9CRVYA020.png "title=" 2.png " alt= "Wkiol1zmj2wgvdzkaacou9crvya020.png"/>

3. Step Three

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/76/29/wKioL1ZMJ3Pi5cxPAADVrLbe1Eg276.png "title=" 3.png " alt= "Wkiol1zmj3pi5cxpaadvrlbe1eg276.png"/>

4. the installation location of the client is not fastidious.

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/76/29/wKioL1ZMJ4DCXjcDAADVkjEChGo275.png "title=" 4.png " alt= "Wkiol1zmj4dcxjcdaadvkjechgo275.png"/>

5. The final step

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/76/29/wKioL1ZMJ43TIbXhAACUezj52oc509.png "title=" 5.png " alt= "Wkiol1zmj43tibxhaacuezj52oc509.png"/>

6. Testing and service-side communication

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/76/2C/wKiom1ZMJ0uAbrvxAAARU5yhjgs777.png "title=" 6.png " alt= "Wkiom1zmj0uabrvxaaaru5yhjgs777.png"/>

Out below this figure is right, if it is across the room, may be relatively slow, to wait a moment

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/76/29/wKioL1ZMJ6XznlqrAAATlU8H8EY196.png "title=" 7.png " alt= "Wkiol1zmj6xznlqraaatlu8h8ey196.png"/>


7. Test Pull Data

For example, pull success

C:\RSYNC\CWRSYNC\BIN>RSYNC.EXE-VZRTOPG--progress [email protected]::p ic/cygdrive/e/data--port=20790

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/76/2C/wKiom1ZMJ5aBFxSyAAAnQVXkUSY905.png "title=" 8.png " alt= "Wkiom1zmj5abfxsyaaanqvxkusy905.png"/>

--progress// show backup Process

--delete// Delete Server in paragraph, Client the end does not. It also means thattheclient wants an empty directory, and if there are files in the directory, it will be emptied.

username in passwd.conf in admin//server side

@42.96.168.171//Server -side address

: the module name defined in rsyncd.conf in the:p IC//server side must be a double colon

/cygdrive/e/data//client side for storing data pulled from server side

--port// Port


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/76/29/wKioL1ZMKBbzI_kBAABQsJ9oMj4097.png "title=" 9.png " alt= "Wkiol1zmkbbzi_kbaabqsj9omj4097.png"/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/76/29/wKioL1ZMKGTyEgi7AAB-ZRXrpFg893.png "title=" 1.png " alt= "Wkiol1zmkgtyegi7aab-zrxrpfg893.png"/>

look at the server side log as follows

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/76/2C/wKiom1ZMKCays1_cAABZWnQoCS0827.png "title=" 2.png " alt= "Wkiom1zmkcays1_caabzwnqocs0827.png"/>

8. setting of environment variables and writing of scripts

Edit when you are in Path, be careful; there is a semicolon in front of the C:\rsync\cwRsync\bin, then turn off the cmd window and open it.

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/76/29/wKioL1ZMKJGzQs4lAACsxOHL7Jo309.png "title=" 3.png " alt= "Wkiol1zmkjgzqs4laacsxohl7jo309.png"/>

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/76/29/wKioL1ZMKKKDlQMdAAAyH9zUm2Y008.png "title=" 4.png " alt= "Wkiol1zmkkkdlqmdaaayh9zum2y008.png"/>

C:\RSYNC\CWRSYNC\PASSWD>RSYNC-VZRTOPG--progress--delete [email protected]::p ic/cygdrive/e/data--port=20790-- Password-file=/cygdrive/c/rsync/cwrsync/passwd/passwd.conf<c:\rsync\cwrsync\passwd\pw.txtpasswordfile must be   Owned by Root when running as rootcontinuingwithout password filepassword:receivingincremental file list./cj/sent61 bytes Received 196 bytes 39.54 Bytes/sectotalsize is 58594377 speedup is 227993.68



RSYNC-VZRTOPG--progress--delete [email protected]::

Pic/cygdrive/e/data--port=20790--password-file=/cygdrive/c/rsync/cwrsync/

Passwd/passwd.conf<c:\rsync\cwrsync\passwd\pw.txt


The good thing about this is that you don't have to build redundant system users. Although it is still a hint :

Passwordfile must is owned by root when running as root

but does not affect the use but keep in mind that the passwd.conf < back of this path to remember, because it is imported, so if the Windows- style path passwd.conf is empty pw.txt Just put the code in there, okay?


write the above script as Bat Plus to the scheduled task

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/76/2A/wKioL1ZMKdvyhNLZAABIk8S0vvE165.png "title=" 1.png " alt= "Wkiol1zmkdvyhnlzaabik8s0vve165.png"/>


9 Scheduled Tasks

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/76/2C/wKiom1ZMKZzw76N6AABZoD0yy1g827.png "title=" 2.png " alt= "Wkiom1zmkzzw76n6aabzod0yy1g827.png"/>


This bat is proven to work.

I use a timing task, also has been put on the network disk, open can be used, convenient, here I set into a loop,

The time is a few seconds to put the bat script path in

the contents of bat are as follows :

RSYNC-VZRTOPG--progress--delete [email protected]::p ic/cygdrive/e/data--port=20790--password-file=/cygdrive/c/ Rsync/cwrsync/passwd/passwd.conf<c:\rsync\cwrsync\passwd\pw.txt

The suffix name must be bat .

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/76/2C/wKiom1ZMK2LDFNYtAACPxnxbmTk138.png "title=" 3.png " alt= "Wkiom1zmk2ldfnytaacpxnxbmtk138.png"/>


three. related parameters
-b, --backup  Create a backup, that is, for the purpose already exists with the same file name, the old file is renamed to ~filename. You can use the--suffix option to specify a different backup file prefix. --backup-dir  store backup files (such as ~filename) in the directory. -suffix=suffix  defines the backup file prefix-u, --update  only updates, that is, skips all the files that already exist in DST, and the file time is later than the file to be backed up. (Do not overwrite updated files)-l, --links  Keep soft links-l, --copy-links  treat soft links like regular files--copy-unsafe-links  Only copy links to links outside the SRC path tree--safe-links  ignore links to the SRC path Tree-h, --hard-links  preserve hard links-p, --perms  Keep file permissions-o, --owner  keep the file belongs to the main information-g, --group  keep the file group information-d, --devices  keep the device file information-t, -- times  Keep file time information-s, --sparse  Special processing of sparse files to save DST space-n, --dry-run The reality of which files will be transmitted-w, -- whole-file  copy files without incremental detection-x, --one-file-system  do not cross file system boundaries-b, --block-size=size  Check the block size used by the algorithm, the default is 700 bytes-e, --rsh=command  Specifies the shell program that replaces rsh--rsync-path=path  specifies the path information for the rsync command on the remote server-C,  --cvs-exclude  uses the same method as CVs to automatically ignore files to exclude files that you do not want to transfer--existing  just update those files that already exist in DST. Instead of backing up those newly created files--delete  Delete those files that are not in the DST SRC--delete-excluded  also deletes the receiving end of those files that are specified by this option--delete-after  the transfer ends and then deletes the--ignore-errors  Timely IO errors are also deleted--max-delete=num  up to delete NUM files--partial  keep files that are not fully transferred for any reason, in order to expedite subsequent retransmission--force  forcibly delete the directory, --numeric-ids  does not match the user and group ID of the number to the user name and group name--timeout=time ip time-out, in seconds, even if not null-i, --ignore-times  Do not skip those files that have the same time and length--size-only  when deciding whether to back up a file, just look at the file size regardless of the file time--modify-window=num  determine whether the file is the same time using the timestamp window, The default is 0-t --temp-dir=dir  create temporary files in dir--compare-dest=dir  also compare files in dir to determine if backup-p  is equivalent to  -- partial--progress  shows the backup process-z, --compress  compressing the backed up files during transport--exclude=pattern  Specifies to exclude file patterns that do not need to be transferred--include=pattern  specifies that file modes that need to be transferred are not excluded--exclude-from=file  exclude files in the specified mode in file--include-from=file   does not exclude file specified pattern matching files--version  print version information--address  bind to a specific address--config=file  specify a different configuration file, Do not use the default rsyncd.conf file--port=port  Specify additional rsync service ports--blocking-io  use blocking for remote shells io-stats  Given the transmission status of certain files--progress  the actual transfer process at the time of transmission--log-format=format  the specified log file format--password-file=file  fromGet password--bwlimit=kbps  limit I/O bandwidth,kbytes per second-h, --help  Display Help in file 


This article is from the "Scattered People" blog, please be sure to keep this source http://zouqingyun.blog.51cto.com/782246/1714001

Windows Rsync synchronization Detailed deployment---Lao Cheng

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.