1. Rsync is an open-source project. First, go to the official website to download the installation package.
Http://rsync.samba.org/ftp/rsync/src/
Here I download 3.1.0.tar.gz
Decompress the package to the/opt/rysnc310 folder. You can directly change the name of the decompressed folder.
2. install three axes. You don't need to talk about this.
For example, add the number of prefix partitions in other places.
3. Configuration
VI/etc/rsyncd. conf
Enter the following information.
Uid = root
Gid = root
PID file =/var/run/rsyncd. PID
Lock file =/var/run/rsyncd. Lock
Log File =/var/log/rsyncd. Log
Motd file =/etc/rsyncd. motd
[Bi_web] # configure the transfer folder on the server
Path =/data/website # server transmission folder
Read Only = No
List = Yes
Hosts allow = * # accept all IP addresses
Auth users = bitrans
Secrets file =/etc/rsyncd. Secrets # Password File
Generate the password file:
Echo "bitrans: bipd">/etc/rsyncd. Secrets, which is in a more strict format than encrypt and must be in the username: Password format
Chmod 600/etc/rsyncd. secrets must be unavailable to other users.
Client:
The installation is the same. No configuration file is required until makeinstall.
Generate a file to transfer the token.
Echo "test"> rsync. Log
Generate the password file. The password must be consistent with the server configuration.
The transfer token is successfully tried.
Rsync-vzrtopgp is basically the default value. If it is changed to another port, the -- Port = port number must be added.
Files transmitted by rsync. Log
[Email protected]: bi_web bitrans is the username configured on the server.
Bi_web is the folder configured on the server.
-- Password-file = bitrans. Pass: Specifies the password file, which must be chmod600.
The server can see the file.
4. Restart
Kill processes at high speed
CAT/var/run/rsyncd. PID | xargs kill-9
Start
/Usr/bin/rsync-daemon (delete the PID file to restart)
Check whether startup is enabled
Netstat-Na | grep 873
You do not need to restart the rsync to change the configuration:
Edit it in/etc/xinetd. d/rsync and set disable to no
/Etc/init. d/xinetd restart. The configuration file read by xinetd is/etc/rsyncd. conf.
Note that no separate rsync process exists.
Rsync Service Installation