rsync服务安装和配置
作者: javaboy2012
Email: [email protected]
qq: 1046011462
rsync服务安装和配置
rsync服务安装:
检查是否安装:
rpm -qa | grep rsync
如果安装了,则需要做如下配置和修改
1. 修改 /etc/xinetd.d/rsync 下的内容
打开启动选项:
disable = yes 改为 disable = no
cat /etc/xinetd.d/rsync
# default: off
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
2. 新建:vi /etc/rsyncd.conf
输入如下内容:
uid = root
gid = root
use chroot = no
max connections = 10
strict modes = yes
pid file=/opt/myysrnc/rsyncd.pid
lock file=/opt/myysrnc/rsyncd.lock
log file= =/opt/myysrnc/rsyncd.log
[www]
path= /data/www
comment= analyse
read only = false
hosts allow = *
3. 启动守护进程
/usr/local/bin/rsync --daemon
客户端:
执行同步命令:
/usr/bin/rsync -arzuv /data/www/ 192.168.136.128::www/
注意:客户端必须执行同步命令触发同步操作.
要实现定时同步,可以通过crontab -e加入定时任务来实现.