Why this script does not work as expected ?

Pierre-Francois LAURAND lists at lrnx.ath.cx
Sat Feb 17 22:19:21 UTC 2007


Kirk Strauser a écrit :
> On Saturday 17 February 2007 12:36, Pierre-Francois LAURAND wrote:
> 
>> /usr/bin/time /usr/bin/nice -n 20 /sbin/dump -C 16 -0 -f- /vol1 | \
>>    /usr/bin/nc -v s-backup 24864
> 
> Try the "-a" option to dump, which tells it to output until it receives a 
> write error.  Otherwise, it tries to chop up the dumps into tape-sized pieces 
> (even when writing to stdout), and the default tape size seems to be tiny.

dump does not seem to be involved :

On client :
backup at client:/tmp$ if (/usr/bin/ssh -c blowfish backup at s-backup \
  /usr/bin/nc -lv 24864 \>/tmp/file.1m &); then \
  /bin/dd if=/dev/random bs=512k count=2 | \
  /usr/bin/nc -v s-backup 24864; fi

On remote, I only have a 1024 bytes file size:

backup at s-backup:/tmp$ ls -l
-rw-r-----   1 backup  operator     -    1024 17 feb 22:52 file.1m

But, if on s-backup :
backup at s-backup:/tmp$ /usr/bin/nc -lv 24864 | /bin/dd of=/tmp/file.1m

And on client :
backup at client: dd if=/dev/random bs=512k count=2 | \
  /usr/bin/nc -v s-backup 24864

I get the expected result on s-backup:

backup at s-backup:/tmp$ ls -l
-rw-r-----   1 backup  operator   - 1048576 17 feb 22:54 file.1m

So, I think that ssh is the one that break the transmission.

-- 
pf


More information about the freebsd-questions mailing list