CentOS 7.2 部署Rsync + Lsyncd服务实现文件实时同步/备份 (三)

配置过程中遇到的错误与查看日志

 

以下错误是在服务正常开启的情况下发生的,请先查看服务是否正常启动。

 

一、错误

1. rsync: failed to set times on "." (in backup): Permission denied (13)

更新.文件的时间失败:原因是权限不够。

此处为selinux权限限制,临时更改为setenforce 0,永久更改为修改/etc/sysconfig/selinux, 将 SELINUX=enforcing 修改为 SELINUX=diabled 或者 SELINUX=permissive

PS:修改系统配置需要重启系统, getenforce 命令查看当前配置值


2. rsync: opendir "/kexue" (in dtsChannel) failed: Permission denied (13)

文件夹权限问题

查看同步的目录权限是否为755

 

3. time out

可能因为客户端或者服务端的防火墙开启 导致无法通信,可以设置规则放行 rsync(873端口) 或者直接关闭防火墙。 

 

二、日志

查看日志信息

tail -10 /var/log/lsyncd.log

如返回: Normal: Finished a list after exitcode: 0   表示同步正常

 

 

******

原文地址:https://www.cnblogs.com/betx/p/6524916.html