rsyncd配置示例,

来源:互联网 发布:淘宝页面图片 编辑:程序博客网 时间:2024/05/21 22:29
请先安装rsync软件。

权限设置:

chmod 777  /etc/rsyncd/rsyncd.secrets

chmod 777 /var/www


文件内容:

[root@localhost rsync]# cat ./rsyncd/rsyncd.conf
motd file = /etc/rsyncd/rsyncd.motd
read>list = yes
uid = nobody
gid = nobody
#uid = root
#gid = root
use chroot = no
read only = no
max connections = 5
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock

[webhome]
comment = testsync directory
path = /var/www
auth users = root
secrets file = /etc/rsyncd/rsyncd.secrets

hosts allow = 192.168.2.115

[root@localhost rsync]# cat /etc/rsyncd/rsyncd.secrets
root:123456

启动:

/usr/bin/rsync --daemon --config=/etc/rsyncd/rsyncd.conf

自启动:

echo "/usr/bin/rsync --daemon --config=/etc/rsyncd/rsyncd.conf" >> /etc/rc.local



0 0