Windows use Cwrsync to regularly back up Web sites (server file synchronization) _win servers

Source: Internet
Author: User
Tags auth rsync
Linux has sync, Windows also has similar software, is Cwrsync, this software is divided into server-side/client. The latest version that can be found is 3.0.1. Download Address Cwrsync Download
1, Cwrsync Installation
The installation process is simple, install the server, and the server includes the client's capabilities. After the server has been installed, the Rsync and SSH services are added to the service and are set to start automatically. After the installation is successful, the file directory to be prepared must be added svcwrsync this user-readable permission.
2, Cwrsync server-side configuration
Enter the Cwrsync installation directory and configure rsyncd.conf as follows.
Program code
Copy Code code as follows:

Use Chroot = False
Strict modes = False
Hosts allow = *
Log file = Rsyncd.log #LOG
PID file = Rsyncd.pid
Secrets file = password # HERE Specifies the username password files in its installation directory, the name is password, its content is txt edit 4,899:4,899 before the user name, followed by the password
# Module Definitions
# Remember Cygwin naming conventions:c:\work becomes/cygwin/c/work
#
[Webbackup]
Path =/cygdrive/d/web/#注意格式, which is a description of the 4899 directory in the D disk Web directory, which is the web directory
Read Only = True #只读
List = no
Auth users = 4899 #指定用户名
Transfer logging = no #是否记录详细的传输情况
[Data]
Path =/cygdrive/d/web/sql_back #这是数据库备分目录
Read Only = True
List = no
Auth users = 4899
Transfer logging = no

Note: Here is the default port 873, if you want to change the port, you need to add port= in conf port number you want, do the port limit to open the Cwrsync use of ports.
3, Cwrsync Automatic data synchronization
Because it's just the simplest data synchronization, you don't have to use SSH to start the rsync service directly. Install Cwrsync,svcwrsync on the client the user needs to be able to write to your designated backup directory and to have permission to read the password file. Then create a new bat file, Data.bat, which reads as follows:
Program code
Copy Code code as follows:

RSYNC-VZRTOPG--progress--delete--password-file=/cygdrive/e/password2 4899@61.152.249.18::d ata/cygdrive/e/web_77 /sql_back

Attention to see:
A,password-file, you want to define a PASSWORD2 file in the specified directory, just write 4899 of the user name corresponding to the password. I am here the password2 under the e-packing catalogue.
b,4899@61.152.249.18::d ata is, user name, server-side ip,config of the paragraph name that needs to be prepared. C,/cygdrive/e/web_77/sql_back the destination of the spare parts.
3, Cwrsync regularly synchronized data
In the Windows Control Panel, point to Schedule tasks, select our new Data.bat, and set up Autorun as needed. It is currently set to synchronize Data 3 o'clock in the morning daily.
PostScript: Here is the configuration of the Cwrsync is completely synchronized, the main station content added or cut, in the Cwrsync synchronization, the same increase or deletion, so each time the search file synchronization will be longer, depending on how many files and server hard disk IO. There are more than 70,000 files in the directory web directory, and the column files are about 10 minutes in length. The first time to prepare for a long time, because more files, the back is to add or subtract, to remove the column file time, the real file transfer times are very short, a will be able to update the finished. If you have any questions in use or some need to exchange, you can visit, point user message and webmaster contact, thank you!

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.