Rsync and cwRsync
! Attention:
Here, rsync is 3.1.0 and the Protocol version is 31.
Cwrsync is 3.0.6 and the Protocol version is 30.
The two can communicate normally!
Rsync For Linux:
1. Download rsync 3.1.0.
Open terminal: wget-c ftp://ftp.samba.org/pub/rsync/rsync-3.1.0.tar.gz
If this ftp is off, you can go to my resources download page: http://download.csdn.net/detail/small_hacker/8097269
2, and then decompress: tar-zxvf rsync-3.1.0.tar.gz
3. Enter the directory after decompression: cd rsync-3.1.0
4. Installation:./configure -- prefix =/usr/local/rsync
Make
Make install
In this way, the installation is complete, and then the configuration is ================
1. Create a configuration Folder: mkdir-p/etc/rsyncd/
2. Create a configuration file and use vim to open vim/etc/rsyncd. conf.
3. Edit. The following is my Configuration:
Log file =/var/log/rsyncd. log
Pid file =/var/run/rsyncd. pid
Lock file =/var/run/rsyncd. lock
# Port = 873
Use chroot = no
Uid = root
Gid = root
# The following describes how to add permissions to the synchronized files (F) and folders (D). The primary users include rwx, other, and group rx. Otherwise, files synchronized from windows will be # unreadable
Incoming chmod = Du = rwx, Dog = rx, Fu = rwx, Fgo = rx
Max connections = 5
Fake super = yes
# Hosts allow = *
# Hosts deny = *
[Message]
Path =/var/www/html/ordinner/Message
Ignore errors
List = no
Read only = false
Auth users = root
Secrets file =/etc/rsyncd. secrets
4. Edit the password file, which is a plaintext text file: vim/etc/rsyncd. secrets
Root: 123
Save and modify the File Permission: chmod 600/etc/rsyncd. secrets
5. Start:/usr/bin/rsync -- daemon -- config =/etc/rsyncd. conf (-- daemon is started in daemon mode)
6. Check whether port 873 is available: netstat-naltp
--- Now the rsync server has been configured! ==============================
The following describes the cwrsync client in windows. The installation process of the Linux client is the same as that of the server. The synchronization command is the same as the following:
1, download csRsync-3.0.6:
Http://download.csdn.net/detail/small_hacker/8097241
2. After installation, add the installation directory to the path variable of windows, so that you can directly call the rsync command under the command line.
3. Open the command line window and execute the command
(The IP address of my server is 192.168.31.23)
Upload Command:
Rsync-av -- progress -- remove-source-files -- exclude-from =/cygdrive/d/upload. list/cygdrive/d/Message/root@192.168.31.213: Message -- password-file =/cygdrive/d/pass/rsyncp. pass
: Message: indicates the [Message] module in rsyncd. conf on the server.
-- Progress: displays the backup process.
-- Remove-source-files: remove the source file after transmission (add as needed)
-- Exclude-from =...: A. list file that specifies the directory of the file not to be uploaded, which is a relative path.
-- Password-file =...: A pass file, saving your own password.
Here/cygdrive/d refers to the windows d disk.
Other parameters are described in detail at Baidu.
Download command:
Rsync-av -- progress -- remove-source-files root@192.168.31.213: Message -- exclude-from =/cygdrive/d/download. list/cygdrive/d/Message -- password-file =/cygdrive/d/pass/rsyncp. pass
Then you can communicate.
In addition, you can log on via ssh, which is more secure. This is because it is a plaintext password file, so it is not secure.