Use cwrsync in Windows to regularly back up websites (Server File sync)

Source: Internet
Author: User

In Linux, there is sync, and in Windows There is similar software, that is, cwrsync, which is divided into servers/clients. The latest version is 3.0.1. Download cwrsync
1. Install cwrsync
The installation process is simple. You can install the server. The server includes the client function. After the server is installed, the rsync and SSH services are added to the service. Go to service management and set it to automatic start. After the installation is successful, the user-readable permission svcwrsync must be added to the file directory for backup.
2. cwrsync Server Configuration
Go to the cwrsync installation directory and configure rsyncd. conf as follows.
Program Code Copy code The Code is as follows: Use chroot = false
Strict modes = false
Hosts allow = *
Log File = rsyncd. log # log
PID file = rsyncd. PID
Secrets file = PASSWORD # the user name and password file is specified in the installation directory. The name is "password". The TXT file is edited as "4899: 4899" before "username" and "password ".
# Module Definitions
# Remember cygwin naming conventions: C: \ work becomes/cygwin/C/work
#
[Webbackup]
Path =/cygdrive/D/web/# note the format. This indicates that the 4899 directory under the web directory of drive D is the web directory.
Read Only = true # Read-Only
List = No
Auth users = 4899 # specify the user name
Transfer logging = No # Whether to record detailed transmission information
[Data]
Path =/cygdrive/D/web/SQL _back # This is the Database Backup Directory
Read Only = true
List = No
Auth users = 4899
Transfer logging = No

Note: The default port 873 is used here. If you want to change the port, you need to add Port = To the conf file. If you have set port restrictions, You need to enable the port used by cwrsync.
3. cwrsync Automatic Data Synchronization
Because it is only the simplest data synchronization, you can simply start rsync without using SSH. Install cwrsync on the client. svcwrsync requires the permission to write data to the specified Backup Directory and read the password file. Create a new BAT file, Data. bat, with the following content:
Program codeCopy codeThe Code is as follows: rsync-vzrtopg -- Progress -- delete -- password-file =/cygdrive/e/password2 4899@61.152.249.18: Data/cygdrive/e/web_77/SQL _back

Note:
A, password-file, you need to define a password2 file under the specified directory, you only need to write the password corresponding to the user name 4899. Here is password2 under the root directory of the E drive.
B, 4899@61.152.249.18: data are, respectively, the user name, Server IP, config in the need to be divided into paragraph name. C,/cygdrive/e/web_77/SQL _back backup point destination.
3. cwrsync regularly synchronizes data
In the Windows Control Panel, click schedule task, select the newly created data. bat, and set automatic running as needed. Currently, it is set to synchronize data at every day.
Note: The cwrsync configured here is completely synchronized. The content of the master site is added or deleted. During cwrsync synchronization, the file search time is also long, depends on the file size and the hard disk I/O of the server. The web directory contains more than 70 thousand files, and the time for column files is about 10 minutes. The first backup time takes a long time. Because there are many files, the files are added or deleted later. Apart from the column file time, the real file transfer time is very short and the update will be completed in a short time. If you have any questions or need to communicate with each other during use, you can visit the website. Please leave a message to contact the webmaster. 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.