rsync (Windows Server, Linux client) synchronizes data on Windows to Linux servers, but

Source: Internet
Author: User

One: General overview,

1, Windows above first loaded Cw_rsync_server.4.1.0_installer, install to enter the user name password to remember Oh! The next step is to find rsyncd.conf into the configuration details

2, Linux only need to install the Rsync tool can (Yum provides */rsync find rsync package to install it)

II: Detail Configuration,

1, the default in C:\Program files (x86) \icw\ under the rsyncd.conf is the main configuration file, password files are generally placed under/etc/rsyncd.secrets

2. The contents of the rsyncd.conf configuration file are as follows:

PID file = Rsyncd.pid
Port = 2878 #此处为端口, the default is 873, if this is changed to other in the Linux client must specify--port=2878, otherwise it will always error!!!
Use Chroot = False
Strict modes = False
Hosts allow = * #允许全部的ip地址范围来同步
Log file = Rsyncd.log
UID = 0
GID = 0
Address = 192.168.1.214 #指定同步的windows服务器地址是谁

[Test] #linux客户端同步指定的模块名字
Path =/CYGDRIVE/C/DB2 #模块名字对应的windows客户端数据的路径
Read Only = False
Transfer logging = yes
Secrets file = Etc/rsyncd.secrets #向windows同步的密码文件

3. Turn on the Rsync service on Windows,

1, Windows key +r The command window, enter "Services.msc", enter the input method into Chinese character input, hit "rsync", press ENTER to search, left click to select Automatic, restart can

2, to this step after the Windows Rsync Server even start to complete!

4. The Linux client installs the Rsync tool and executes the following commands to synchronize,

1, RSYNC-VZRTOPG--progress--password-file=/etc/rsyncd.secrets--port=2878 [email protected]::test/home/client

1.1 、--Password-file=/etc/rsyncd.secrets:

Specify the server-side C:\Program files (x86) \icw\etc\rsyncd.secrets password file (to set the appropriate password format on the server: Account: Password)

1.2 、--port=2878 If the rsyncd.conf written on the windows above is 873, there is no need to specify

1.3, [email protected]::test installed cw_rsync_server.4.1.0 when the user name @windows data synchronization Address:: Test for the Write module

5, on the Linux side write script the shortest one minute synchronization, to the specified directory on Linux synchronization

1. Create a rsync.sh script:

#!/bin/bash
#This is a rsync.sh

/USR/BIN/RSYNC-VZRTOPG--progress--password-file=/etc/rsyncd.secrets--port=2878 [email protected]::test/home/ Client &>/dev/null &

6, add to Crontab scheduled task inside can,

1, CRONTAB-E

* * * * * */bin/bash/root/rsync.sh &>/dev/null

Three: To perform the following commands to sync from Linux data to Windows:

Rsync Unison-2.13.16/rsync://[email Protected]:2878/test

1. Rsync unison-2.13.16/specifies files synced to Windows on Linux, followed by format

rsync (Windows Server, Linux client) synchronizes data on Windows to Linux servers, but

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.