On 2/21/07, Dave Markham <dave.markham@fjserv.net>
wrote:> Has anyone any idea why this wont work? Its in a script and im passing
> -e "${SSH}" to the Rsync command where :-
>
> SSH="$(/usr/bin/which ssh) -o ConnectTimeout=15 -o BatchMode=yes
-n"
> rsync: connection unexpectedly closed (0 bytes read so far)
> rsync error: error in rsync protocol data stream (code 12) at io.c(165)
> rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
> rsync error: error in rsync protocol data stream (code 12) at io.c(463)
> [receiver=2.6.8]
The -n option closes the half of the connection that sends data from
the local computer to the remote computer. This messes rsync up
because rsync requires a connection that can send data both ways. Get
rid of the -n.
Explanation of the error message: When the remote rsync tries to read
from the local rsync, it fails, writes the first "connection
unexpectedly closed", and quits. That causes ssh to drop the entire
connection, so when the local rsync then tries to read from the remote
rsync, it fails and writes the second "connection unexpectedly closed"
message.
Matt