Rsync implementation Linux file synchronization to Windows configuration detailed

Source: Internet
Author: User
Tags auth svn rsync

Description
This article implements Linux timed to www,msyql,svn directory rsync to win2003 designated directory.
Win2003 install Cwrsync, as the server side of Rsync, running the Cwrsync daemon daemon, accept the files synchronized with Linux;
Linux for CentOS, itself has rsync, on time rsync files to win.

Environment:
Win2003 192.168.1.2 cwrsync RSYNCD server, run with daemon daemon
Linux 192.168.1.3 rsync Client

Realize:
1.WIN2003 installation Cwrsync and firewall settings
Please refer to: Cwrsync graphics and text installation

2. Modify Cwrsync configuration file rsyncd.conf (cwrsync installation directory, my installation directory here is: D:cwrsync)

The code is as follows Copy Code

UID = 0
GID = 0
Use chroot = False
Strict modes = False
hosts allow = 192.168.1.3
Log file = Rsyncd.log

# M Odule Definitions
# Remember Cygwin naming conventions:c:work becomes/cygwin/c/work
#
[www]
Path =/cyg drive/e/bakup/1_3/www //cwrsync automatically mount all disks on the system to/cygwin/x, so/cygdrive/e/bakup/1_3/www refers to the e:bakup1_3www directory
Read Only = False
Transfer logging = yes
Auth users = rsyncd
Secrets file =/cygdrive/d/cwrsync/rsyncd.se Crets

[mysql]
Path =/cygdrive/e/bakup/1_3/mysql
Read Only = False
Transfer logging = yes
Auth user s = Rsyncd
Secrets file =/cygdrive/d/cwrsync/rsyncd.secrets

[svn]
Path =/cygdrive/e/bakup/1_3/
Read O nly = False
Transfer logging = yes
Auth users = rsyncd
Secrets file =/cygdrive/d/cwrsync/rsyncd.secrets

/td>


3. Add cwrsync Password file d:cwrsyncrsyncd.secrets
RSYNCD:RSYNCD//User: Password

All above are win2003 operation, below is the operation under Linux
4. Add rsync password file, so Linux timed rsync directory to Win2003 do not need to enter the password

The code is as follows Copy Code
# cat/root/rsyncd.secrets

RSYNCD//Enter password directly


5. Modify Crontab, timed to inspire rsync synchronization

  code is as follows copy code

# CRONTAB-E  //Add the following
3 * * * rsync-vrlptd--progress--password-file=/root/rsyncd.secrets/home/www/data rsyncd@192.168 .45.2::WWW
3 * * * rsync-vrlptd--progress--password-file=/root/rsyncd.secrets/home/mysql/data rsyncd@192.168.4 5.2::mysql
3 * * * rsync-vrlptd--progress--password-file=/root/rsyncd.secrets/home/svn RSYNCD@192.168.45.2::SV N

&NBSP
Appendix:
Appendix 1. Running on the Linux side # RSYNC-AVRTOPG--progress--password-file=/root/rsyncd.secrets/home/www/data RSYNCD@192.168.45.2::RSYNCD will appear password file must not is other-accessible
continuing without password file
Password:
The problem password file must is Other-accessible has answered, and the files that save the password/root/rsyncd.secrets should not be readable by other users.
# chmod 600/root/rsyncd.secrets//Modify permission is 600

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.