rsync 通过密码文件实现远程同步

1、源文件服务器:192.168.10.203

2、备份服务器:192.168.10.88

配置备份服务器(192.168.10.88)

vim /etc/rsync.conf

uid = www
gid = www
read only = no
hosts allow = *
[web]
path = /var/www
auth users = yyp
secrets file = /etc/rsyncd.secrets
vim /etc/rsyncd.secrets
yyp:123456
chmod 600 /etc/rsyncd.secrets
useradd yyp
echo "123456" | passwd yyp --stdin
mkdir /var/wwww
启动服务
rsync --daemon --config=/etc/rsyc.conf

 配置源服务器

vim /etc/rsyncd.secrets
123456
chmod 600 /ec/rsyncd.secrets
mkdir /var/www
 同步文件
rsync -avz --password-file=/etc/rsyncd.secret /var/www yyp@192.168.10.88::web
错误汇总:
rsync: recv_generator: mkdir "test" (in dest) failed: Permission denied (13)
*** Skipping everything below this failed directory ***
这个表明权限不正确解决办法三个:(1)把备份服务器/etc/rsync.conf gid和uid 修改为root; (2)把备份目录上的权限设置为777;(3)修改备份目录拥有者和所属组为/etc/rsync.conf配置文件中的gid和uid
rsync: read error: Connection reset by peer (104)rsync error: error in rsync protocol data stream (code 12) at io.c(614) [receiver=2.6.8]
通过日志/var/log/messages查看得到
rsync: unable to open configuration file "/etc/rsync.conf": No such file or directory (2)
做一个软连接上去:ln -s /etc/rsyncd.conf /etc/rsync.con

来源:https://my.oschina.net/yyping/blog/91964

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值