Rsync download, installation, and Configuration

Source: Internet
Author: User

RSYNC software introduction: 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.
Software Download
The home address of rysnc is:
Http://rsync.samba.org/
The latest version is 2.4.6. You can choose to download from the original website:
Http://rsync.samba.org/ftp/rsync /. You can also download rsync 2.4.6 from this site.


1. Download and install rsync
# Tar zxvf rsync-2.6.9.tar.gz
# Cd rsync-2.6.9
#./Configure -- prefix =/usr/local/rsync
# Make
# Make install
* *** RSYNC is enabled for normal RH installation, and the running file is stored in/usr/bin/rsync.


Ii. rsync download and configuration rsync server
1. Start RSYNC
# Vi/etc/xinetd. d/rsync
Change the original YES to NO.

 
 
  1. Service rsync
  2. {
  3. Disable = no
  4. Socket_type = stream
  5. Wait = no
  6. User = root
  7. Server =/usr/bin/rsync
  8. Server_args = -- daemon
  9. Log_on_failure + = USERID
  10. }
  11. Start RSYNC with the System
  12. # Chkconfig rsync on


2. Configure/etc/rsyncd. conf (manually generated)
The parameters of rsyncd. conf are written on the top as global parameters, and the parameters of modules are written on the top.
# Vi/etc/rsyncd. conf
Global Parameters
Uid = root // the user who runs the RSYNC daemon
Gid = root // the group that runs the RSYNC daemon
Use chroot = no // do not use chroot
Max connections = 4 // The maximum number of connections is 4
Strict modes = yes // check the permission of the password file
Port = 873 // default port 873

Module Parameters
[Backup] // The Authentication Module name. You must specify
Path =/home/backup // the directory to which the image is to be created. It is indispensable!
Comment = This is a test // comments of This module
Ignore errors // ignore irrelevant IO errors
Read only = yes // read-only
List = no // column files are not allowed
Auth users = hening // The authenticated user name. If this row is not used, it indicates that the user is anonymous and has nothing to do with the system.
Secrets file =/etc/rsync. pas // table of password and user name comparison. The password file is generated by yourself.
Hosts allow = 192.168.1.1, 10.10.10.10 // allow hosts
Hosts deny = 0.0.0.0/0 // disable host
# Transfer logging = yes

Note: The following green files are automatically generated after the RSYNC service is installed.
Pid file =/var/run/rsyncd. pid // storage location of the pid file
Lock file =/var/run/rsync. lock // location of the lock file
Log file =/var/log/rsyncd. log // location where the log file is stored


3. rsync download and configuration the rsync password has been written in the above configuration file)/etc/rsync. pas name can be written at will, as long as it is consistent with the above configuration file), format (one row per user)
Account: Password
# Vi/etc/rsync. pas
Example:
Hening: 111111
Permission: Because rsync. pas stores the user name and password of the rsync service, it is very important. Set rsync. pas to be owned by the root user and the permission is 600.
# Cd/etc
# Chown root. root rsync. pas
# Chmod 600 rsync. pas
3. rsyncd. motd configuration welcome information, optional)
# Vi/etc/rsyncd. motd
Rsyncd. motd records the welcome information of the rsync service. You can enter any text information, such:
Welcome to use the rsync services!
4. Make the configuration take effect
# Service xinetd restart

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.