我是 Linux 新手,我正在使用 rsync 将日志从一台服务器复制到另一台服务器,但我运行的命令显示目录未找到。出了什么问题?
001 rsync -u -avze ssh /apps/container-log/* [email protected]:~/apps/test-rsync
[email protected]'s password:
sending incremental file list
rsync: change_dir#3 "/local_home/user/apps" failed: No such file or directory (2)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(614) [receiver=3.0.6]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(605[sender=3.0.9]
答案1
你的命令是:
rsync -u -avze ssh /apps/container-log/* [email protected]:~/apps/test-rsync
我建议您直接将 移除~/
。然后尝试如下操作:
rsync -u -avze ssh /apps/container-log/* [email protected]:apps/test-rsync
但我不太确定您设置的选项,因此我建议您使用此命令:
rsync -avz /apps/container-log/* [email protected]:apps/test-rsync
我们甚至可以--dry-run
选择不实际运行该命令就可以查看它的功能:
rsync -avz --dry-run /apps/container-log/* [email protected]:apps/test-rsync