Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to ftp a compressed file through a pipe, saving disk space

Status
Not open for further replies.

pipo

Programmer
Feb 4, 2002
5
AE
Hi everyone!
I'm trying to ftp a compressed file without uncompressing it first. This is what i tried, which works fine with export/import Oracle utilities:

mknod ftp_pipe3 p
uncompress < export_248.log.Z > ftp_pipe3 &
set -x
ftp -ni <<EOF
open 172.27.x.x
user oracle Oracle
bin
put ftp_pipe3 export_248.log.Z
close
bye
EOF

But doesn't work, error is:

$./uncompress_and_ftp.sh
+ ftp -ni
+ 0< /tmp/sh233526.2
./ftp_pipe3: not a plain file.

Any idea?
 
Hi there pipo,

I see what you're trying to do but I don't think you need to. You'll get faster transfer times if you use ftp to xfer the *compressed* version of the file. Uncompress it at the other end. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
True, but there's a problem. what I want is to have the file gzipped on another system (Digital). Somehow, when ftp is done with the .Z file, uncompressing ang gzipping on the other machine returns a file which is the same in size, but different in content (bdiff returns some differences) with the file transferred uncompressed.
Maybe the the problem is in uncompress and gzip versions. Guess what the problem is?
 
I've never had a problem with .Z files when working between different systems; I don't, however, have a similar length of experience with gzip. Have you tried it with just compress? Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Yes, it's a solution, i'll go on with it, the use of gzip is because it compresses much more. But the original question still remains, it could be interesting to solve, if possible. If not, thanks anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top