Jim Gallagher
2004-Sep-16 14:07 UTC
Rsync param parsing using --rsh broken? (was: no subject)
Reposting this with a subject line :-) Hi, I'm trying to get rsync over OpenSSH/Cygwin working. I started with a command like this (which fails): $ rsync -v -v -v --recursive --rsh="ssh -i /home/ul081b/mpdm-keys/rsa-mpdm01mpdm@mpdm-w2k3" MPDM-W2K3::MPDM . opening connection using ssh -i /home/ul081b/mpdm-keys/rsa-mpdm01 mpdm@mpdm-w2k3 MPDM-W2K3 rsync --server --daemon . bash: line 1: MPDM-W2K3: command not found rsync: connection unexpectedly closed (0 bytes read so far) rsync error: error in rsync protocol data stream (code 12) at /home/lapo/package/tmp/rsync-2.6.2/io.c(342) _exit_cleanup(code=12, file=/home/lapo/package/tmp/rsync-2.6.2/io.c, line=342): about to call exit(12) The above example should work, if I'm reading the docs correctly. After hours of getting nowhere, I tried this (which worked, but it doesn't look to me that this is the way the docs say to do it) (the only difference is I left out the hostname adjacent to the module): $ rsync -v -v -v --recursive --rsh="ssh -i /home/ul081b/mpdm-keys/rsa-mpdm01 mpdm@mpdm-w2k3" ::MPDM . opening connection using ssh -i /home/ul081b/mpdm-keys/rsa-mpdm01 mpdm@mpdm-w2k3 rsync --server --daemon . Global parameter log file found in service section! receiving file list ... recv_file_name(.) recv_file_name(COPYING) recv_file_name(INSTALL) recv_file_name(NEWS) recv_file_name(README) recv_file_name(TODO) received 6 names done recv_file_list done get_local_name count=6 . generator starting pid=2180 count=6 delta transmission enabled recv_generator(.,0) recv_files(6) startingrecv_generator(COPYING,1) recv_generator(INSTALL,2) recv_generator(NEWS,3) recv_generator(README,4) recv_generator(TODO,5) generate_files phase=1 recv_files(COPYING) COPYING got file_sum renaming .COPYING.000820 to COPYING recv_files(INSTALL) INSTALL got file_sum renaming .INSTALL.000820 to INSTALL recv_files(NEWS) NEWS got file_sum renaming .NEWS.000820 to NEWS recv_files(README) README got file_sum renaming .README.000820 to README recv_files(TODO) TODO got file_sum renaming .TODO.000820 to TODO recv_files phase=1 generate_files phase=2 recv_generator(.,0) generate_files finished recv_files finished wrote 161 bytes read 57446 bytes 23042.80 bytes/sec total size is 57100 speedup is 0.99 rsync error: some files could not be transferred (code 23) at /home/lapo/package /tmp/rsync-2.6.2/main.c(1048) _exit_cleanup(code=23, file=/home/lapo/package/tmp/rsync-2.6.2/main.c, line=1048 ): about to call exit(23) So, what's going on here? Am I missing something in the docs, is something wrong in the docs or is this a bug? Thanks, Jim Gallagher Cypress, CA -------------- next part -------------- HTML attachment scrubbed and removed
Wayne Davison
2004-Sep-16 16:49 UTC
Rsync param parsing using --rsh broken? (was: no subject)
On Thu, Sep 16, 2004 at 07:06:54AM -0700, Jim Gallagher wrote:> $ rsync -v -v -v --recursive --rsh="ssh -i /home/ul081b/mpdm-keys/rsa-mpdm01mpdm@mpdm-w2k3" MPDM-W2K3::MPDM .That line must have contained a space prior to the mpdm@mpdm-w2k3 part or it wouldn't have failed as it did. That is specifying a user+hostname to ssh, and rsync always supplies the hostname, so obviously that conflicts. If you want to specify an ssh user when using a daemon-over-ssh command, use the -l option to ssh: rsync -vrt --rsh="ssh -i /home/ul081b/mpdm-keys/rsa-mpdm01 -l mpdm" mpdm-w2k3::MPDM . ..wayne..
On Thu Sep 16 16:48:39 GMT 2004, Wayne Davison wrote:>> $ rsync -v -v -v --recursive --rsh="ssh -i /home/ul081b/mpdm-keys/rsa-mpdm01mpdm at >mpdm-w2k3" MPDM-W2K3::MPDM . > >That line must have contained a space prior to the mpdm at mpdm-w2k3 part >or it wouldn't have failed as it did. That is specifying a >user+hostname to ssh, and rsync always supplies the hostname, so >obviously that conflicts. If you want to specify an ssh user when using >a daemon-over-ssh command, use the -l option to ssh: > >rsync -vrt --rsh="ssh -i /home/ul081b/mpdm-keys/rsa-mpdm01 -l mpdm" mpdm-w2k3::MPDM . > >..wayne..Wayne, Thanks for the reply. I disagree with your analysis, however. Here is a test with your suggestion (notice that the command not found complains about the uppercase MPDM-W2K3). Also, the logs show that the ssh connection was established, so the entire quoted param for --rsh is likely correct (it works with both the @ and the -l): $ rsync -v -v -v --recursive --rsh="ssh -i /home/ul081b/mpdm-keys/rsa-mpdm01 -l mpdm mpdm-w2k3" MPDM-W2K3::MPDM . opening connection using ssh -i /home/ul081b/mpdm-keys/rsa-mpdm01 -l mpdm mpdm-w2k3 MPDM-W2K3 rsync --server --daemon . bash: line 1: MPDM-W2K3: command not found rsync: connection unexpectedly closed (0 bytes read so far) rsync error: error in rsync protocol data stream (code 12) at /home/lapo/package /tmp/rsync-2.6.2/io.c(342) _exit_cleanup(code=12, file=/home/lapo/package/tmp/rsync-2.6.2/io.c, line=342): about to call exit(12) Jim
OK, now I see. I did not notice the --rsh param is not the exact command that would invoke ssh by itself. Thanks for your help.>On Thu, Sep 16, 2004 at 11:51:00AM -0700, jim wrote: >> notice that the command not found complains about the uppercase MPDM-W2K3 > >That's because you didn't remove the hostname from the ssh command like >I told you to (see my original command suggestion). > >..wayne..-------------- next part -------------- HTML attachment scrubbed and removed