Windows 上的 Rsync - 非套接字上的套接字操作

发布于 2024-07-05 07:07:53 字数 512 浏览 10 评论 0原文

当我尝试在 Windows XP SP2 中运行最新的 Cygwin 版本的 rsync 时,出现以下错误。 尝试本地同步(即:仅本地硬盘上的源和目标)和远程同步(使用 openssh 包中的“-e ssh”)时会发生错误。 关于如何修复/解决它有什么建议吗?

bash-3.2$ rsync -a dir1 dir2
rsync: Failed to dup/close: Socket operation on non-socket (108)
rsync error: error in IPC code (code 14) at /home/lapo/packaging/tmp/rsync-2.6.9/pipe.c(143) [receiver=2.6.9]
rsync: read error: Connection reset by peer (104)
rsync error: error in IPC code (code 14) at /home/lapo/packaging/tmp/rsync-2.6.9/io.c(604) [sender=2.6.9]

I get the following error when trying to run the latest Cygwin version of rsync in Windows XP SP2. The error occurs for attempts at both local syncs (that is: source and destination on the local harddisk only) and remote syncs (using "-e ssh" from the openssh package). Any advice on how to fix/workaround it?

bash-3.2$ rsync -a dir1 dir2
rsync: Failed to dup/close: Socket operation on non-socket (108)
rsync error: error in IPC code (code 14) at /home/lapo/packaging/tmp/rsync-2.6.9/pipe.c(143) [receiver=2.6.9]
rsync: read error: Connection reset by peer (104)
rsync error: error in IPC code (code 14) at /home/lapo/packaging/tmp/rsync-2.6.9/io.c(604) [sender=2.6.9]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

我ぃ本無心為│何有愛 2024-07-12 07:07:55

您可能有什么东西阻止了 rsync。 就我而言,它是 NOD32 防病毒软件。 您可以通过在“gdb”中运行 rsync 来检查这一点,如下所示:

$ gdb --args /usr/bin/rsync -a somedir/ anotherdir
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
.....
(no debugging symbols found)
(gdb) run 

注意 gdb 启动后的“run”命令。 您将看到如下输出:

Starting program: /usr/bin/rsync -a somedir/ anotherdir
.....
(no debugging symbols found)
warning: NOD32 protected [MSAFD Tcpip [TCP/IP]]
warning: NOD32 protected [MSAFD Tcpip [UDP/IP]]
warning: NOD32 protected [MSAFD Tcpip [RAW/IP]]
warning: NOD32 protected [RSVP UDP Service Provider]
warning: NOD32 protected [RSVP TCP Service Provider]
(no debugging symbols found)
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
[New thread 1508.0x720]
[New thread 1508.0xeb0]
[New thread 1508.0x54c]
rsync: Failed to dup/close: Socket operation on non-socket
(108)
rsync error: error in IPC code (code 14) at
/home/lapo/packaging/rsync-3.0.4-1/src/rsync-3.0.4/pipe.c(147)
[receiver=3.0.4] 

因此,您必须将 rsync 添加到该病毒扫描程序 (NOD32) 的排除列表中:

c:\cygwin\bin\rsync.exe

You probably have something blocking rsync. In my case it's NOD32 antivirus. You can check this by running rsync in 'gdb' as follows:

$ gdb --args /usr/bin/rsync -a somedir/ anotherdir
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
.....
(no debugging symbols found)
(gdb) run 

note the "run" command after gdb has started. You will see some output like this:

Starting program: /usr/bin/rsync -a somedir/ anotherdir
.....
(no debugging symbols found)
warning: NOD32 protected [MSAFD Tcpip [TCP/IP]]
warning: NOD32 protected [MSAFD Tcpip [UDP/IP]]
warning: NOD32 protected [MSAFD Tcpip [RAW/IP]]
warning: NOD32 protected [RSVP UDP Service Provider]
warning: NOD32 protected [RSVP TCP Service Provider]
(no debugging symbols found)
(no debugging symbols found)
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)
[New thread 1508.0x720]
[New thread 1508.0xeb0]
[New thread 1508.0x54c]
rsync: Failed to dup/close: Socket operation on non-socket
(108)
rsync error: error in IPC code (code 14) at
/home/lapo/packaging/rsync-3.0.4-1/src/rsync-3.0.4/pipe.c(147)
[receiver=3.0.4] 

So you will have to add rsync to your exclude list in that virus scanner (NOD32):

c:\cygwin\bin\rsync.exe

请别遗忘我 2024-07-12 07:07:55

请注意,如果通过 SSH 连接使用 rsync,Cygwin 中长期存在的管道实现错误会导致 rsync 挂起。

从 Cygwin v. 1.7 开始,使用 rsync 传输大量数据的唯一可靠方法似乎是使用 rsync 协议连接到 rsync 守护进程。 DeltaCopy 只是这个方法的一个漂亮的包装。

一些用户显然已经成功地通过 SSH 将数据从 Windows 推送到 Unix,而不是从 Windows 拉取 Unix 端的数据。 但根据我们的经验,这也是不可靠的。

Google 搜索 cygwin、rsync、ssh 和 pipeline/hang/stall,您会找到有关此问题的更多信息。

Be aware that a long-standing pipe implementation bug in Cygwin causes rsync to hang if it's used through an SSH connection.

As of Cygwin v. 1.7 it seems that the only reliable way to transfer lots of data with rsync is to connect to an rsync daemon using the rsync protocol. DeltaCopy is just a pretty wrapper around this method.

Some users apparently have had success on top of SSH pushing data from Windows to Unix instead of pulling from Windows on the Unix side. In our experience that's unreliable too, though.

Google for cygwin, rsync, ssh and pipe/hang/stall and you'll find more information about this problem.

天冷不及心凉 2024-07-12 07:07:55

并不是您问题的真正答案,但我发现 Delta Copy 是一个比摆弄 Cygwin 更好的选择。 它也连接到常规 rsync 守护进程。

Not really an answer to your question, but I've found Delta Copy to be a much better option than messing around with Cygwin. It connects to regular rsync daemons too.

咽泪装欢 2024-07-12 07:07:55

我发现这是一个 winsock 错误。 我确认问题是由于为 Sierra Wireless Aircard (875U) 安装 ATT 通信管理器(版本 6.12.0046.0)而开始的。 卸载 Communications Manager,rsync 错误就会消失。

I have found this to be a winsock error. I confirmed the problem starts with the installation of the ATT Communcations Manager (version 6.12.0046.0) for the Sierra Wireless Aircard (875U). Uninstall the Communications Manager and the rsync error goes away.

梦里寻她 2024-07-12 07:07:55

遵循@akaihola的建议后,我发现 这篇博客文章提供了相同问题的解决方案。
我在这里发布了解决方案,但版权归 Marc Abramowitz

cygrunsrv --install "rsyncd" --path /usr/bin/rsync --args "--daemon --no-detach" --desc "Starts a rsync daemon for accepting incoming rsync connections" --disp "Rsync Daemon" --type auto

当然,您需要带有 rsync 的 Cygwin。

After following @akaihola ’s advice I found this blog post with the solution to the same problem.
I post the solution here, but the credits go to Marc Abramowitz

cygrunsrv --install "rsyncd" --path /usr/bin/rsync --args "--daemon --no-detach" --desc "Starts a rsync daemon for accepting incoming rsync connections" --disp "Rsync Daemon" --type auto

Of course you need Cygwin with rsync.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文