Linux: quick setup and use of rsync servers-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Rsync is a data image backup tool in unix-like systems. It can be seen from the software name-remote sync. Its features are as follows:
Images can be used to save the entire directory tree and file system.
It is easy to maintain the permissions, time, and soft links of the original file.
Installation without special permissions.
Optimized process, high file transmission efficiency.
You can use rcp, ssh, and other methods to transmit files. Of course, you can also use a direct socket connection.
Supports anonymous transmission for website images.
Step
1. Download: http://rsync.samba.org/ftp/rsync/ from original website
2. [root @ localhost bin] #./configure
[Root @ localhost bin] # make
[Root @ localhost bin] # make install
Note that rsync must be installed on both the client and server. The client runs rsync as a client, and the server runs rsync as a server. It listens to port 873.
3. Run rsync
/Usr/local/bin/rsync -- daemon
Verify that the startup is successful:
Netstat-na | grep 873
4. Configure rsync
Simple configuration: edit the/etc/rsyncd. conf file as follows:
# Global configuration
Secrets file =/etc/rsyncd. secrets name and location of the authenticated user name and password file
Motd file =/etc/rsyncd. motd welcome information file name and storage location (this file does not exist, you can add it yourself)
Read only = yes
List = yes
Uid = root
Gid = root
# Hosts allow = 10.4.5.213
# Hosts deny = 10.4.5.0/24
Use chroot = no
Max connections = 5
Log file =/var/log/rsyncd. log
Pid file =/var/run/rsyncd. pid
Lock file =/var/run/rsync. lock
# Module configuration
[Paolo]
Comment = Paolo's directory
Path =/home/test/software
Auth users = rsync
# Secrets file =/etc/rsyncd. secrets
5. Generate verification documents
Echo "rsync: rsync_password">/etc/rsyncd. secrets
Chmod 600/etc/rsyncd. secrets
6. Synchronize files on the server on the client server
Or add the -- password-file =/etc/rsyncd. secrets option.
The above command transfers the directory files in the paolo module on the 10.4.5.161 server to the local/china directory, and deletes the files not in the directory specified by the paolo module on the 161 server in the local/china directory. To synchronize the directory files of the two computers.
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.