一、rsync服务
1.1 not a regular file 不是普通文件
scp跟cp类型,默认只能复制普通文件
复制目录,加上-r参数即可
[root@backup ~]# scp /etc/ 172.16.1.31:/tmp
root@172.16.1.31's password:
/etc: not a regular file
1.2 command not found 命令找不到
远程服务器没有rsync这个命令,rsync这个命令是默认安装的,检查如果没有,yum install -y rsync 安装即可
[root@backup ~]# rsync -av /etc 172.16.1.31:/tmp
root@172.16.1.31's password:
bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(226) [sender=3.1.2]
1.3 Connection refused 连接拒绝
1>检查是否能ping通对应服务器。
2>检查对应服务器的rsync服务是否启动,如果没有,启动即可。
[root@backup ~]# rsync -avz /etc 176.16.1.31:/tmp
ssh: connect to host 176.16.1.31 port 22: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]
1.4 Unknown module 'backup'
未知模块“backup”
1>模块写错了,与rsync配置文件中配置的模块不一致,修改一致即可
2>书写的
[root@nfs01 ~]# rsync -avz /etc/hostname rsync_backup@172.16.1.41::backup
@ERROR: Unknown module 'backup'
rsync error: error starting client-server protocol (code 5) at main.c(1648) [sender=3.1.2]
[root@nfs01 ~]#
1.5 auth failed on module data 验证模块数据失败
1>密码写错
2>rsync服务/etc/rsyncd.conf配置文件中用户连接认证密码文件不存在,添加即可
3>密码文件的权限不对,修改600即可