1834816 Members
2241 Online
110070 Solutions
New Discussion

Re: SCP with compression

 
Roger Cowan
New Member

SCP with compression

Hi,
I am fairly new to the ideas and use of SSH so apologies if I am asking something really obvious.

I have a basic scp command (which is run as part of a script),
scp usr1@rmtsrv:file1.dat file2.dat

This command runs fine, however I want to change the script to explicitly state whether compression should be used or not.

Various posts (particularly http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x061c6049dbb6d611abdb0090277a778c,00.html)
seem to imply that this should be achievable using a -C option but the man pages make no mention of it.

The closest I can find is using
'-o Specify additional options for ssh2.'
and putting the
'+C Enable compression.' command within.


scp -C usr1@rmtsrv:file1.dat file2.dat
returns
illegal option -- C

scp -o +C usr1@rmtsrv:file1.dat file2.dat
ssh2: FATAL: Illegal -o parameter "+C"


The 2 boxes are both running F-Secure SSH 3.0.1 (build 6) on hppa1.1-hp-hpux11.00


Am I going about this in the right way? and is it even possible?

Thanks in advance

Roger
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: SCP with compression

scp docs say this...


-C Compression enable. Passes the -C flag to ssh(1) to enable compression.

The doc seems to agree with you.

My test with Linux(HP box, finally in the house YEAH!, is turned off) should show same results.

My version on HP-UX is 3.50 from HP tested depots.

Secure shell
http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=T1471AA

If you compiled some other version, you are taking risks of bugs and difficulties with HP-UX.

I'm attaching Chris Vail's secureshell doc, because it contains lots of cool nuggets.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Caesar_3
Esteemed Contributor

Re: SCP with compression

Hello!

You also should know that ssh already use
compression with the zlib so the data
is compresd in the minimal way.

If you want to made more compression i
don't think that it will be good
couse the speed of transfer on fast
network will more slow.
Let's say that you will use bzip2 so to
compress the data you will loose time also
for decompres also it's cpu that will work
on this.

First you should think if it worth it.

Caesar
Roger Cowan
New Member

Re: SCP with compression

Cesar,

I am aware that it may not be best to always run compression - making us constrained by cpu rather than bandwidth, and it is for this reason that I want to have the option of switching it.

I am not sure if I unsderstood your comment about bzip2, this is not part of the ssh?
I could run the files through a compress and uncompress before and after the scp, but, I was under the impression that it was possible to enable a higher level of compression as an option in the command - this was more what my question was aimed at.

Regards

Roger