Rsync synchronous Backup from Windows to Linux

Source: Internet
Author: User
Tags rsync

Name Role IP Address
Windows Server 2003 Server eth0:192.168.1.1
RHEL5.5 Client eth0:192.168.1.2
First, cwrsyncserver server configuration Download Server Cwrsyncserver decompression Cwrsyncserver_4.0.3_installer.zip, double-click Cwrsyncserver_4.0.3_installer.exe
My Computer-right-click management---Services and apps-Service find Rsyncsever, double-click-Start
Provide desktop interaction

Open the E-drive, create a folder to back up, named Benet (here is the folder, not the file) right-click the Benet folder, select Properties, switch to security options, point to add Input: Svccwrsync

Open the C:\Program FILES\ICW directory with Notepad open rsyncd.conf, modify add the following (back up before modifying, in case of error re-change)

Edit rsyncd.conf File Use chroot = falsestrict modes = falsehosts Allow = *log file = rsyncd.log # Module definitions# Remember C Ygwin naming Conventions:c:\work becomes/cygwin/c/work#
[Benet] #备份模版path =/cygdrive/e/benetread = True #客户端只读hosts allow = 192.168.1.2 #允许连接IP, multiple IPs are separated by commas in English, do not restrict IP filling * Uth users = benet #允许连接的用户名secrets file = Etc/rsyncd.secrets #存放用户名密码的认证文件路径

Under C:\Program FILES\ICW directory, create a new/etc/rsyncd.secrets file with Notepad Open, enter your username and password benet:123
Ii. rsync Client Configuration 1, review the selinux mechanism, turn off Selinux[[email protected] ~]# getenforceDisabled2, turn on the wall TCP 873 port for later server use [[email Protected] ~]# vi/etc/sysconfig/iptables #编辑防火墙配置文件-A input-m state–state new-m tcp-p tcp–dport 873-j ACCEPT
3. Install rsync client software [[email protected] ~]# Yum install rsync xinetd[[email protected] ~]# vi/etc/xinetd.d/rsync #编辑配置文件, set boot up        Rsync, rsync on CentOS using xinetd enabled Disable=yes, changed to noservice rsync{disable = no Socket_type = Stream wait = no user = root Server =/usr/bin/rsync Server_args =--daem On Log_on_failure + = userid}/etc/init.d/xinetd start #启动
4. Test the remote test if you can communicate properly, install Telnet[[email protected] ~]# telnet 192.168.1.1 873 #成功Trying 192.168.1.1...Connected to 192.168.1.1 (192.168.1.1). Escape character is ' ^] '. @RSYNCD: 30.0
Synchronizing data in order to enter the password is not entered manually, we also create a client-side password file (this file path and password to the same server side, the client does not have to write the name) [[email protected] ~]# echo "123" >/etc/ Rsyncd.secrets #文件名可以不一样, but in/etc [[email protected] ~]# cat/etc/rsyncd.secrets123[[email protected] ~]# chmod 600/etc/ Rsyncd.secrets
Synchronizing data on the client note: The password here is the password configured for the Cwrsyncserver server C:\Program files\icw\etc\rsyncd.secrets file [[email protected] ~]# Rsync-avz-- password-file=/etc/rsyncd.secrets [email protected]::benet/opt/receiving file list ... done./11.txt sent bytes Receiv Ed 192 bytes 51.45 Bytes/sectotal size is 0.18
5. Achieve automatic synchronization of data, manually write a small script. After the colon is the template defined on the server side [[email protected] ~]# vim Rsync.sh#!/bin/bash/usr/bin/rsync-avz--password-file=/etc/ rsyncd.secrets [email protected]::benet/opt join automated backup [[email protected] ~]# chmod +x/root/rsync.sh[[email protected] ~]# C rontab-e* * * * */root/rsync.sh

Rsync synchronous Backup from Windows to Linux

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.