首先设置配置,配置文件在目录:
配置文件的权限如下:
rsyncd.conf的配置内容如下:
pid file = /var/run/rsyncd.pid port = 873 uid = nobody gid = nobody use chroot = yes read only = yes max connections = 5 motd file = /etc/rsync/rsyncd.motd log file = /var/log/rsync.log log format = %t %a %m %f %b syslog facility = local timeout = 300 [xxx] path=/home/wwwroot/xxx.com list=yes ignore errors read only=no uid = root gid = root auth users = root secrets file = /etc/rsync/rsyncd.secrets [log-xxx.com] path=/home/wwwlogs/history list=yes ignore errors read only=yes uid = root gid = root auth users = root secrets file = /etc/rsync/rsyncd.secrets
rsyncd.secrets配置用户内容如下:
root:jUCGgH9OySLFtiTF
rsyncd.motd欢迎信息配置如下:
hellow gay
rsync启动命令如下:
/usr/bin/rsync --daemon --config=/etc/rsync/rsyncd.conf