I have been working overtime, working overtime ...... On a stormy night a few days ago, I couldn't sleep on the opposite side. For a rough calculation, I took two and a half days off in August and three and a half days off in August, I usually get home after every night, and sometimes I work overtime all night. I have never carefully thought about why I am so desperate. Now I want to think about it, and I suddenly find that I have picked up the ideal that I used to quit, it seems that you have the willingness and the ability to make a sigh of relief for the past, and find yourself so important to prove your value to others! Because of this, I am willing to endure such a gap when I am not too concerned about money. Although it seems that I am living for others to a large extent, it is so nice; heart is good-that's enough.
Although this is the case, my heart is not happy. Today, a colleague asked me if I felt very full. I thought for a moment and said, "I feel very tired ...... Then it seems to be a lot of virtual resources, and I really want to relax ...... I 've talked so much about it, and it's a serious problem. The frequency of blog writing is actually inversely proportional to my laziness. I usually say that I am busy and have no time to write, it is actually self-deception. I just synchronized a static resource yesterday. I will record it today.
CwRsync is a cross-platform open source file synchronization backup software, which is easy to use. In my environment, both the Server and Client are Windows 2008 Server R2, the Server IP address is 10.0.0.4, and the Client IP address is 10.0.0.2.
The server and client software can be downloaded from the official website. You can simply double-click the software to complete the installation, which is very simple. It should be noted that when installing the Server, there is a dialog box for creating users. Because my environment is 2008R2, the complexity of the password must comply with the 2008R2 standard, otherwise, the service cannot be installed and there is no prompt. The username I created is FileSync and the password is 1Qaz2Wsx.
Server:
Let's talk about the server configuration, which is mainly the configuration file rsyncd. conf. The content is easy to understand and will not be explained one by one. What I Want To synchronize is the two folders of disk D image and Upload;
1. paste your configuration file as follows:
use chroot = falsestrict modes = falsehosts allow = *log file = rsyncd.logpid file = rsyncd.pidport = 800max connections = 4UID=0GID=0# Module definitions# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work##[test]#path = /cygdrive/c/work#read only = false#transfer logging = yes[image]path = /cygdrive/d/imageread only = falsetransfer logging = yeslock file = rsyncd.lockauth users =FileSyncsecrets file = etc/rsyncd.secrets[Upload]path = /cygdrive/d/Uploadread only = falsetransfer logging = yeslock file = rsyncd.lockauth users =FileSyncsecrets file = etc/rsyncd.secrets
2. Create the password file rsyncd. secrets and put it into the etc folder. The format is "user: passwd", for example, "FileSync: 1Qaz2Wsx ";
3. Modify the firewall configuration and open port 800 configured in the configuration file;
4. modify the permissions of the image and Upload folders of the d disk to be synchronized, and add the user FileSync to fully control the two folders;
Now, the server configuration is complete.
Client:
The client configuration is simpler, and a script can complete all the synchronization tasks.
1. Create the script rsync. bat. The content of my script is as follows:
@ Echo offecho. echo starts data synchronization. Please wait... echo. cd C: \ Program Files (x86) \ cwRsync \ binrsync-vzrtopg -- port = 800 -- progress -- delete FileSync@10.0.0.4 :: image/cygdrive/d/image <passwd.txt rsync-vzrtopg -- port = 800 -- progress -- delete FileSync@10.0.0.4: Upload/cygdrive/d/Upload <passwd.txt echo. echo Data Synchronization completes echo.
2. Create a new password file passwd.txt, input the password 1qaz2wsx, and place rsync.batand passwd.txt in the same directory;
3. Enable the RsyncServer service on the server, and execute scripts to complete the synchronization task. If you need timed synchronization, add a Windows scheduled task.
This article from the "Rainbow cat sword walking Tianya" blog, please be sure to keep this source http://ailurus.blog.51cto.com/4814469/1218169