The following is my installation process
First, the server-side installation
1. System environment
Server: centos6.5 factory Environment (default setting when system is installed), ip:192.168.10.185
Client: Telnet terminal xshell5 or SECURECRT (for specific installation and use, please consult yourself),
ip:192.168.10.186
2. Install Rsync
Log in to the system via terminal (here is Xshell) 192.168.10.185
Rpm-qa|grep rsync*//Check to see if this service is currently installed, and if you have a low version, you can perform
RPM-E rsync*//Uninstall and change software
Installation method One:
Execute yum-y Install rsync
Rpm-qa|grep rsync*//Execute this statement to view information about installed software
Rsync.x86_64 0:3.0.6-12.el6
Installation Method Two:
Download the source package on the Rsync website: http://rsync.samba.org/ Package Name: rsync-3.1.1.tar.gz
Yum-y Install Lrzsz//Enter RZ at the command line: Upload the source package just downloaded to the server
Tar zxf rsync-3.1.1.tar.gz
CD rsync-3.1.1
./configure--prefix=/app
Make
Make install
Startup file Location:/app/bin/rsync
3. Create an Rsync profile (not by default)
Create rsyncd.conf (service profile) separately under/etc/
RSYNC.PASSWD (account and password to store client Login rsync service)
RSYNCD.MOTD (Welcome or description information when logging into the service, free designation, optional)
##########################################################################################
vim/etc/rsyncd.conf//Create a service configuration file
UID = root
GID = root
Port = 873//Specify the ports to be accessed, default is 873, or you can specify
Hosts allow = client IP address//client allowed access
#hosts deny =
#user chroot =
#max connections =
#timeout =
[Backup]
Path =/bak//Note, if this directory is not, do not forget to create Oh!
Comment = rsync files
Ignore Erros
Read Only = no
List = yes
Auth usres = rsync//sync authentication with the account, if not the anonymous synchronization, client synchronization without a user name can also be synchronized.
Secrets file =/ETC/RSYNC.PASSWD//Where the certified files are stored
#########################################################################################
VIM/ETC/RSYNC.PASSWD//Create an authentication file
SYJ:SYJ2015//must be in this format, rsync account is the Auth users in the service profile, they are consistent on the line, password self-determined.
chmod 600/etc/rsync.passwd//Change file permissions for owner Read only
4. Firewall settings
Iptables-a input-p TCP--dport 873-j ACCEPT//server locally accessible, can be used to test first
Iptables-i input-p TCP--dport 873-j ACCEPT//client can access
5. Start the Rsync service
/usr/bin/rsync--daemon
6. See if the service is started
[[email protected] ~]# lsof-i: 873
COMMAND PID USER FD TYPE DEVICE size/off NODE NAME
rsync 28055 root 3u IPv4 81353 0t0 TCP *:rsync (LISTEN)
rsync 28055 root 5u IPv6 81354 0t0 TCP *:rsync (LISTEN)
This condition is enabled for the service
Second, the installation of the client
1. As with the server installation, execute the yum-y install rsync
2. Start Rsync, execute/usr/bin/rsync--daemon
3. After the 2nd step executes, "Failed to parse config file:/etc/rsyncd.conf" appears,
Workaround, create an empty configuration file vim/etc/rsyncd.conf, and perform step 2nd again
Third, the example (this experiment service end ip:192.168.10.185, client ip:192.168.10.186)
1. Log in to the client,put the server on the/bakThe contents of the folder are backed up to the client's/ImageFilein:
/app/bin/rsync-vzrtopg--delete --progress [email protected]: : Bak/imagefile
2. Log in to the client and back up the contents of the Client/ImageFile folder to server/bak:
/APP/BIN/RSYNC-VZRTOPG--delete--progress/imagefile [email protected]::backup --password-file=/etc/secret.pas ( Password verification can be provided automatically)
This article is from the "Linux in Practice" blog, so be sure to keep this source http://zhangguangjun.blog.51cto.com/4629376/1715637
rsync Remote file Synchronization service setup under Centos6.5