In my post

        Re: ssh returns before remote output complete?

that still hasn't surfaced on the ssh list as far as I have been
able to determine, I made one miniscule error -- the cpio copy-
out command had the "B" flag appended.  But I only accounted for
512 bytes for the loss of the last transmitted buffer -- ssh2
tends not to finish sending the final 512 byte buffer over a
link so one needs to compensate by adding 512 bytes of junk at
the end of a transmission, and also, the process must be done
manually so one can ^C it when all done.


This is the fixed version of the now working cpio over ssh2
(fssh-2.0.9) command:


cd /
find proj -depth -print0 | ( cpio -0oa -H crc ; \
        dd if=/dev/zero bs=512 count=1 2>/dev/null ) | \
        ssh2 -l root ruth '( cd /fscd ; cpio -idum -H crc )'


But if one wants the B flag still in, one must increase the dd
bs correspondingly:


cd /
find proj -depth -print0 | ( cpio -0oaB -H crc ; \
        dd if=/dev/zero bs=5120 count=1 2>/dev/null ) | \
        ssh2 -l root ruth '( cd /fscd ; cpio -idum -H crc )'


Again, does anyone know the real reason this problem occurs?!


Thank,
________________________________________________________________
Leif Erlingsson,  Katrinebergsvagen 70, 146 50  Tullinge, Sweden
TEL +46 8 778-5038, MOB +46 709 14-0631, URL http://www.lege.com


PS1:    The above command is copying 1.37 GB of data, so it
        isn't finished yet, but once it does, I'll report the
        outcome.  Should be OK though!

PS2:    Background:

Date: Tue, 17 Nov 1998 11:35:42 +0100
From: Roman Maeder <[EMAIL PROTECTED]>
Subject: ssh returns before remote output complete?

I am observing occasional cases where an ssh connection returns
before the remote pipe has finished its output, resulting in
loss of the end of the remote output.
  ....



Leif:

Myself, I have been able to consistently repeat the problem
given identical circumstances each time.  (I have a dedicated
10 Mbps ethernet cable between two compters.)

E.g., if I don't append the 5120 null bytes with the above
cpio command, this is how the destination timestamps look like:

 .
 .
 .
drwxrwxr-x  10 leif     adm          3072 Jun 22 15:14 domains
drwxrwxr-x   3 leif     adm          1024 Jun 24 20:00 mailx2
drwxrwxrwt   3 root     root         3072 Jul  9 17:34 tmp
drwxr-xr-x   6 root     root         1024 Jul 10 03:04 ..
drwxrwxr-x   2 leif     adm          5120 Jul 10 06:32 scancem
lrwxrwxrwx   1 leif     adm            23 Jul 10 06:35 trickokn -> 
/usr/local/doc/trickokn
drwxrwxr-x   2 leif     adm          1024 Jul 10 06:38 solaris
drwx------   6 leif     adm          3072 Jul 10 07:04 n-plex


While on the source, this is how the last date-stamps look like:

 .
 .
 .
drwxrwxr-x  10 leif     adm          3072 Jun 22 15:14 domains/
drwxrwxr-x   3 leif     adm          2048 Jun 24 20:00 mailx2/
drwxrwxrwt   3 root     root         3072 Jul  9 17:34 tmp/


And the other directories have these datestamps:

drwxrwxr-x   2 leif     adm          5120 Sep 11  1998 scancem/
lrwxrwxrwx   1 leif     adm            23 Apr  9  1998 trickokn -> 
/usr/local/doc/trickokn/
drwxrwxr-x   2 leif     adm          1024 Oct 30  1998 solaris/
drwxrwxr-x   6 leif     adm          3072 Jun  9 00:21 n-plex/



Executing this command instead, I found that the last 485 bytes
wasn't written:

ssh2 -l root ruth.swip.net \
        '( cd /usr/src ; find . -type d -print )' \
        2>&1 | tee /tmp/files-as-root


By adding 512 bytes of nulls like below, I got all my real data
through (and plenty of "end-of-string" - characters on top of
that. :-) ):

ssh2 -l root ruth.swip.net \
        '( cd /usr/src ; find . -type d -print ; \
        dd if=/dev/zero bs=512 count=1 2>/dev/null )' \
        2>&1 | tee /tmp/files-as-root

Reply via email to