Synchronization of mail server data using rsync under Windows

Source: Internet
Author: User
Tags rsync

Synchronization of mail server data using rsync under Windows

Background environment

For the system administrator, the usual focus should be on maintaining the normal operation of the system, to provide services, often involved in a data backup problem, in my understanding of the situation, 80% of the system administrators are not too concerned about the security of their own servers, but often the technology of the backup image is quite interested in However, because the hardware and software prices of commercial products are very high, so often choose free software. Rsync is the software that can meet the vast majority of requirements that are not particularly high for backup needs. For the data is not very large, massive small file storage backup, combined with the server itself disk array technology, can effectively enhance the security of the data.

Server Requirements

Server (server side) that needs to back up files: 192.168.10.158 (Windows Server 2003)

Server (client) receiving backup files: 192.168.10.159 (Windows Server 2003)

Implementation features

Incremental backup of the accounts directory and conf directory of the Turbomail mail server via the Rsync tool.

Accounts directory: A directory for storing user-related information

Conf Directory: User profile storage Directory

Network topology structure

1. Download the Rsync tool for Windows edition

Rsync version 2.4.6 (can get the latest version from http://rsync.samba.org/rsync/)

Server side: Cwrsync_server_2.0.10_installer.zip

Client side: Cwrsync_2.0.10_installer.zip

2. Installation and Configuration

Server side:

Installing Cwrsync_server_2.0.10_installer.zip

After installation, open the "Start a UNIX bash Shell" program in the Start-"program-" Cwrsync server:

Enter a cmd-like terminal and enter the following command:

$/bin/activate-user.sh

Input L

Input Administrator

The back is all pressed back to the end

3. Start Opensshd

Open the Control Panel--> Administrative Tools--> Services:

Find a opensshd service and start it

4. Edit the configuration file C:\Program Files\cwrsyncserver\rsyncd.conf,rsync main profile

Start the Rsync service

Open the Control Panel--> Administrative Tools--> Services:

Find a Rsyncserver service and start it

To the end of this server-side configuration, configure the client side next.

Client side:

Installing the client side package: Cwrsync_2.0.10_installer.zip

Open cmd and do the following to test whether the server is starting the service properly:

CD C:\Program Files\cwrsync\bin

Telnet 192.168.10.158 22

Telnet 192.168.10.158 873

If the above test succeeds, the synchronization schedule can be executed at this time:

C:\Program FILES\CWRSYNC\BIN>RSYNC-VZRTOPG--progress--Delete 192.168.10.158:c:/turbomail/accounts/turbomail ( At this point, you will be prompted for a password, the user name is administrator, the password is 192.168.10.158 Administrator login password) to this, the installation configuration Windows to Windows synchronization is OK if you synchronize the files on the server regularly, It can be added to a task plan.

Client synchronization Commands Explained

V,--verbose verbose mode output

Q,--quiet thin output mode

C,--checksum Open the check switch to force the verification of the file transfer

A,--archive archive mode, which means to transfer files recursively and keep all file attributes equal to-rlptgod

R,--recursive sub-directories are processed in recursive mode

R,--relative using relative path information

B,--backup create the backup, that is, for the purpose already exists to have 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 Defining backup File prefixes

U,--update only updates, that is, skipping all the files that already exist in DST, and the file time is later than the file to be backed up. (Does not overwrite the updated file)

L,--links reserved Soft link

L,--copy-links to handle soft links like regular files

Copy-unsafe-links only copies links to links outside the SRC Path directory tree

Safe-links ignoring links to the SRC Path directory tree

H,--hard-links reserved Hard link

P,--perms maintain file permissions

O,--owner keep file owner information

G,--group keep file group information

D,--devices keep device file information

T,--times keep file time information

S,--sparse Special processing of sparse files to save DST space

N,--dry-run Reality which files will be transmitted

W,--whole-file Copy file, no incremental detection

X,--one-file-system do not cross file system boundaries

B, the--block-size=size test algorithm uses the block size, the default is 700 bytes

E,--rsh=command specifies the shell program to replace Rsh

Rsync-path=path Specify 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 only updates those files that already exist in DST without backing up those newly created files

Delete Deletes those files that are not in the DST SRC

Delete-excluded also deletes those files that are excluded by the option specified by the Receive side

Delete-after transfer ends after removal

ignore-errors Timely IO errors are also deleted

Max-delete=num deleting NUM files up to a maximum

Partial retains files that are not fully transmitted for any reason, to expedite subsequent transmissions

Force forces the removal of the directory, even if it is not empty

Numeric-ids does not match the user and group ID of a number to a user name and group name

Timeout=time IP time-out, in seconds

I,--ignore-times do not skip 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 file time

Modify-window=num determines whether the file is time-stamped with the time Stamp window, which defaults to 0

T--temp-dir=dir Creating temporary files in Dir

Compare-dest=dir also compares the files in DIR to determine if a backup is required

P is equivalent to--partial

Progress Show backup process

Z,--compress compress the backed-up files while they are being transmitted

Exclude=pattern specify to exclude file modes that do not need to be transferred

Include=pattern specifies file modes that need to be transferred without exclusion

Exclude-from=file exclude files in the specified schema in file

Include-from=file does not exclude files that specify pattern matching

Version Print release information

Address is bound to a specific location

Config=file specify a different configuration file, do not use the default rsyncd.conf file

Port=port Specify a different rsync service port

Blocking-io using blocking IO for remote shells

Stats gives the transfer status of some files

Progress in the transmission of the real-time transmission process

Log-format=format specifying the log file format

Password-file=file get the password from file

bwlimit=kbps limit I/O bandwidth, Kbytes per second

H,--help display Help information

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.