【发布时间】:2021-10-23 19:15:17
【问题描述】:
我正在使用空的/home/pantelis 文件夹(即目标目录)进行下面的两个实验
此命令成功:
rsync -zalP --progress --exclude=.git --exclude=.vscode /Users/pantelis/Workspace/my-work/terragrunt/modules/ my-server:/home/pantelis/my-work/
即在my-server 上,my-work 目录被创建并且具有/Users/pantelis/Workspace/my-work/terragrunt/modules/ 的内容
在远程机器上,我现在删除了/home/pantelis/my-work,所以/home/pantelis 再次为空。
我尝试如下运行rsync 命令,但现在失败了
▶ rsync -zalP --progress --exclude=.git --exclude=.vscode /Users/pantelis/Workspace/my-work/terragrunt/modules/ my-server:/home/pantelis/my-work/terragrunt/modules/
building file list ...
1114 files to consider
rsync: connection unexpectedly closed (8 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /System/Volumes/Data/SWE/macOS/BuildRoots/d7e177bcf5/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/io.c(453) [sender=2.6.9]
我正在尝试这个,显然我希望远程文件结构与本地文件结构匹配。
为什么第二次尝试失败了?
是因为(某些内在原因)rsync 不能创建除叶子之外的任何其他目录吗? (my-work)?在那种情况下,我尝试了--relative 建议的here 选项,但没有任何成功。
【问题讨论】: