我在 Windows 中使用 rsync ( 通过cygwin64
) 将一些数据备份到 samba 共享。我制作了这个 bat 文件来处理所有事情:
net use S: \\10.1.1.23\marc password /user:marc
rsync -rtvu --delete /cygdrive/d/Backup/ /cygdrive/s/sync/Backup/
rsync -rtvu --delete /cygdrive/d/Marc/programmeren/ /cygdrive/s/sync/Marc/programmeren/
rsync -rtvu --delete /cygdrive/d/Marc/School/ /cygdrive/s/sync/Marc/School/
rsync -rtvu --delete /cygdrive/d/Marc/Werk/ /cygdrive/s/sync/Marc/Werk/
rsync -rtvu --delete /cygdrive/d/Marc/Thuis/docs/ /cygdrive/s/sync/Marc/Thuis/docs/
pause
net use S: /delete
pause
第一个rsync
命令运行良好,但之后的命令只会出现错误。这是我得到的输出:
C:\Users\Marc\Desktop>rsync -rtvu --delete /cygdrive/d/Backup/ /cygdrive/s/sync/
Backup/
sending incremental file list
created directory /cygdrive/s/sync/Backup
./
Mail/
Mail/Thunderbird 24.5.0 (nl) - 2014-05-09.pcv
sent 76601561 bytes received 38 bytes 6661008.61 bytes/sec
total size is 76592063 speedup is 1.00
C:\Users\Marc\Desktop>rsync -rtvu --delete /cygdrive/d/Marc/programmeren/ /cygdr
ive/s/sync/Marc/programmeren/
sending incremental file list
rsync: mkdir "/cygdrive/s/sync/Marc/programmeren" failed: No such file or direct
ory (2)
rsync error: error in file IO (code 11) at /usr/src/ports/rsync/rsync-3.0.9-1/sr
c/rsync-3.0.9/main.c(587) [Receiver=3.0.9]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /usr/src/ports/rsy
nc/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [sender=3.0.9]
C:\Users\Marc\Desktop>rsync -rtvu --delete /cygdrive/d/Marc/School/ /cygdrive/s/
sync/Marc/School/
sending incremental file list
rsync: mkdir "/cygdrive/s/sync/Marc/School" failed: No such file or directory (2
)
rsync error: error in file IO (code 11) at /usr/src/ports/rsync/rsync-3.0.9-1/sr
c/rsync-3.0.9/main.c(587) [Receiver=3.0.9]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /usr/src/ports/rsy
nc/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [sender=3.0.9]
C:\Users\Marc\Desktop>rsync -rtvu --delete /cygdrive/d/Marc/Werk/ /cygdrive/s/sy
nc/Marc/Werk/
sending incremental file list
rsync: mkdir "/cygdrive/s/sync/Marc/Werk" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at /usr/src/ports/rsync/rsync-3.0.9-1/sr
c/rsync-3.0.9/main.c(587) [Receiver=3.0.9]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /usr/src/ports/rsy
nc/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [sender=3.0.9]
C:\Users\Marc\Desktop>rsync -rtvu --delete /cygdrive/d/Marc/Thuis/docs/ /cygdriv
e/s/sync/Marc/Thuis/docs/
sending incremental file list
rsync: mkdir "/cygdrive/s/sync/Marc/Thuis/docs" failed: No such file or director
y (2)
rsync error: error in file IO (code 11) at /usr/src/ports/rsync/rsync-3.0.9-1/sr
c/rsync-3.0.9/main.c(587) [Receiver=3.0.9]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /usr/src/ports/rsy
nc/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [sender=3.0.9]
有人能解释一下为什么这不起作用吗?我已经chmod 777 -R
打开了/home/marc/
,但也没用……
我的 rsync 版本:version 3.0.9 protocol version 30
顺便说一句,我没有使用 SSH,因为我在家庭网络中使用它
-在职的-
好的,现在它已经正常工作了。我手动创建了根目录 (marc/programmeren, marc/school, marc/...
现在它可以正常工作了。
那么你们知道有什么更好的方法来处理这个异常吗?(如果尚未创建,RSync 将手动创建这些文件夹...)