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.
- Service rsync
- {
- Disable = no
- Socket_type = stream
- Wait = no
- User = root
- Server =/usr/bin/rsync
- Server_args = -- daemon
- Log_on_failure + = USERID
- }
- Start RSYNC with the System
- # 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