Cwrsync implement data synchronization backup from Linux to Windows _win Server

Source: Internet
Author: User
Tags file permissions rsync

The latest version of Rsync can be obtained from http://rsync.samba.org/rsync/. Its characteristics are as follows:
  
1, can be mirrored to save the entire directory tree and file system.
  
2, it is easy to maintain the original file permissions, time, soft and hard links and so on.
  
3, no special permission can be installed.
  
4, the optimized process, the file transmission efficiency is high.
  
5, can use RCP, ssh and other means to transfer files, of course, can also be connected through the direct socket.
  
This article describes how to use the Rsync service to remotely backup from Linux to Windows.
  
First, configure the server side
  
First we need to configure rsync, open the profile/etc/xinetd.d/rsyncd.conf (if not, create it), modify the appropriate configuration items, and add the following:
  
UID = Nobody # Backup in what capacity, User ID
GID = Nobody # Backup in what capacity, group ID
  
#注意这个用户ID和组ID, it can be set to root if it's convenient, so rsync can almost # read any files and directories, but it also poses a security risk. Recommended set to read only you have to prepare
  
#份的目录和文件即可.
Max connections = 4 # Maximum number of connections is 4
  
[www] # Specify a certified Backup module name
Path =/www # The directory to be backed up
Comment = BACKUP WWW # comment
Ignore errors # Ignores some irrelevant IO errors
Read Only = yes # set to read only
List = no # does not allow column files
Auth users = wwwuser # authenticated username, if not, indicates anonymous
Hosts allow=220.122.133.31 #允许连接服务器的主机IP地址
Secrets file =/etc/wwwuser.pass # Authentication file name, used to store passwords
  
We have finished this section.
  
Note: If you need to back up other directories at the same time, you can continue to add the configuration content directly after the configuration file, for example:
  
[Database]
Path =/var/lib/mysql
......
  
This allows you to back up multiple directories at the same time.
  
Then set the password file for the backup module, such as the password file for/etc/wwwuser.pass, use the editor to create the file, and enter the user name and password:
Vi/etc/wwwuser.pass
  
Enter the following content:
wwwuser:123456
  
In this way, password 123456 is set for the user Wwwuser of the backup module www. Note that for security purposes, the property of this file must be owner-readable or rsync will refuse to run. We can set it to a property of 600:
chmod 600/etc/wwwuser.pass
  
Setting up the Rsync service starts automatically when the system starts, and can be set by NTSYSV:
After the server side we need to start the Rsync service:
Service xinetd Restart
  
At this point, the server-side configuration is complete.
  
Second, configure the client
  
To use the Rsync tool in a Windows environment, we need to download the Cwrsync tool, which is a version of Rsync for Windows.
  
After downloading the installation, the directory structure is similar to the following figure:
Now we can run the Rsync tool in a Windows environment, using the following command to connect to the server and start backing up directories and files:
RSYNC-VZRTOPG--progress--delete wwwuser@xx.xx.xx.xx::www. \bak
You should see:
Password
  
A prompt for a password is required, and you should see the start of the backup after you have entered the password correctly. Of course, you may also receive an error message similar to the following:
There are several possibilities of causing this error, one is that you do not enter the correct username or password, and the second is that your server-side files that store passwords do not have the correct permissions, that is, your password file is not like this permission:-rw-------1 root root

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.