Cwrsync to implement synchronous backups between Windows servers

Source: Internet
Author: User
Tags file copy zip ssh domain server file permissions rsync

Cwrsync Division client and service end two parts, take Cwrsync 4.0, respectively corresponding to Cwrsync_4.0.5_installer.zip and Cwrsyncserver_4.0.5_installer.zip

1, the installation ofCwrsync service side configuration
1 Install the cwrsyncserver server side on the domain server (cwrsyncserver_4.0.5)
Note: During the installation process, the default username and password for Cwrsync will appear as follows:

You must modify the username and password of the current system administrator to start the Cwrsync service:

3 Prepare to use the file folder (file server directory) and the Data folder (database directory) on the domain server as the folder where you want to synchronize the files.
4 Open the service-side rsyncd.config file, the default configuration is as follows:

5 Modify the contents of the rsyncd.config file for what we need, as follows:
Note: In the above section, set the listening port to the default value of 873.
6 in the Control Panel--> management tool--> Service, find the service and start it, the following figure:

2, thecwrsync Client Installation configuration
1 Install client cwrsync_4.0.5 on the backup server, create a folder called Sync, and create two folders named "File" and "Data" below to synchronize the folders on the domain server.


2 Create a file Password.txt in C disk and write to the domain server Administrator's login password.
3 Create a batch file named Work_rsync.bat in the following section:

--These two processes are incremental backups.

Rsync-avz--progress Administrator@192.168.1.87::t_file/cygdrive/c/sync/file <c:password.txt
Rsync-avz--progress Administrator@192.168.1.87::t_data/cygdrive/c/sync/data <c:password.txt

and place it in the bin directory under the Cwrsync Client installation directory (my installation directory is as follows: C:Program Filescwrsyncbin), and then double-click to start it. This will start synchronizing the files:



After that, we can see the synchronized files in the corresponding directory in C:sync, as follows.

Note: Cwrsync is the way to increment and modify synchronization, when the corresponding file on the server side is modified, the client synchronizes the modified files or new files.

Finally, we can use the Windows Planning task to synchronize the instance.

rsync Command Parameters detailed

Rsync has six different modes of operation:
1 Copy Local files. This mode of operation is initiated when both SRC and des path information do not contain a single colon ":" delimiter. such as: Rsync-a/data/backup
2 Use a remote shell program (such as rsh, SSH) to copy the contents of the local machine to the remote machine. This mode is started when the DST path address contains a single colon ":" Separator. such as: Rsync-avz *.c foo:src
3 Use a remote shell program (such as rsh, SSH) to copy the contents of the remote machine to the local machine. This mode is started when the SRC address path contains a single colon ":" Separator. such as: Rsync-avz Foo:src/bar/data
4 Copy files from remote rsync server to local machine. This mode is started when the SRC path information contains the "::" delimiter. such as: Rsync-av Root@172.16.78.192::www/databack
5 copy files from local machine to remote rsync server. This mode is started when the DST path information contains the "::" separator. such as: Rsync-av/databack root@172.16.78.192::www
6 The list of files for the remote machine. This is similar to rsync transmission, but simply omitting the local machine information in the command. such as: Rsync-v rsync://172.16.78.192/www
The specific explanation for the rsync parameter is as follows:
-V,--verbose verbose mode output
-Q,--quiet thin output mode
-C,--checksum Open the check switch to force the file transfer to verify
-A,--archive archive mode, which represents the transfer of files recursively and maintains all file attributes equal to-rlptgod
-R,--recursive the subdirectory in recursive mode
-R,--relative using relative path information
-B,--backup creates a backup, which means that the old file is renamed to ~filename for the same file name already exists for the purpose. You can use the--suffix option to specify different backup file prefixes.
--backup-dir store backup files (such as ~filename) in the directory.
-suffix=suffix defines the backup file prefix
-U,--update only updates, skipping all files that already exist in DST, and the file time is later than the file you want to back up. (Do not overwrite the updated file)
-L,--links retention soft link knot
-L,--copy-links to treat soft links like regular files
--copy-unsafe-links only copies links that point beyond the src Path directory tree
--safe-links ignores links to the SRC path tree
-H,--hard-links keep hard links
-P,--perms keep file permissions
-O,--owner keep file owner information
-G,--group keep file group information
-D,--devices maintain device file information
-T,--times keep file time information
-S,--sparse special handling of sparse files to save DST space
-N,--dry-run which files will be transmitted
-W,--whole-file copy files without incremental detection
-X,--one-file-system do not cross file system boundaries
-B, the block size used by the--block-size=size test algorithm is 700 bytes by default
-E,--rsh=command specifies the use of rsh, SSH mode for data synchronization
--RSYNC-PATH=PATH Specifies the path information for the rsync command on the remote server
-C,--cvs-exclude use the same method as CVs to automatically ignore files to exclude files that you do not want to transfer
--existing updates only those files that already exist in DST, not the newly created files
--delete Delete files that are not in the DST SRC
--delete-excluded also deletes the receiving end of files that are excluded by the option specified
--delete-after after transmission is over
--ignore-errors in time IO errors are also deleted
--max-delete=num Delete NUM files up to
--partial retains files that are not fully transmitted for some reason, to expedite subsequent transmissions
--force forcibly deletes a directory, even if it is not empty
--numeric-ids does not match the user and group IDs of numbers to user and group names
--timeout=time IP timeout time in seconds
-I,--ignore-times 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 without considering the file time
--modify-window=num the time stamp window that determines whether a file is in the same time, default is 0
-t--temp-dir=dir create temporary files in dir
--compare-dest=dir also compares files in DIR to determine whether a backup is required
-P equals to--partial
--progress Display backup process
-Z,--compress compression of backed-up files on transfer
--EXCLUDE=PATTERN Specifies to exclude file modes that do not require transfer
--INCLUDE=PATTERN Specifies the file mode that is not excluded and needs to be transferred
--exclude-from=file exclude files in the specified mode in file
--include-from=file does not exclude files that match the file-specified pattern
--version Print version Information
--address bound to a specific address
--CONFIG=FILE specifies a different profile and does not use the default rsyncd.conf file
--PORT=PORT Specifies the other rsync service ports
--blocking-io blocking IO for a remote shell
-stats gives the transfer status of some files
--progress transmission process in real time
--log-format=format Specify log file format
--password-file=file gets the password from file
--bwlimit=kbps limit I/O bandwidth, Kbytes per second
-H,--help display Help information

The AZV option is generally used

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.