Operating System - HP-UX
1833758 Members
2182 Online
110063 Solutions
New Discussion

How to concatenate and FTP

 
Chandrakumar Karunamoor
Occasional Advisor

How to concatenate and FTP

I have a bunch of big files and i need
to concatenate them and then ftp that
single file (concatenated file).

I wonder if there is a way to ftp that
single concatenated file directly to
destination without first landing it in
the host machine.

Thank you,
Chandra
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: How to concatenate and FTP

Hi:

You could bundle them into a tar archive, ftp the tar ball, and then un-tar them on the receiving server.

Regards!

...JRF...
Volker Borowski
Honored Contributor

Re: How to concatenate and FTP

Hi,
not sure if I got you right (?)

You need file1, file2, file3 from host_a to be transfered to a single "fileCONCAT" on host_b, but do not have the space to create "fileCONCAT" on host_a before the transmission ?

This sounds to be a problem for a remote shell call and some redirections rather than ftp. Shorthand try (not sure about needed quotes for ">" and "<":

cat file1 | rsh targethost 'cat > fileCONCAT'
cat file2 | rsh targethost 'cat >> fileCONCAT'
cat file3 | rsh targethost 'cat >> fileCONCAT'

The idea should be clear, I am not at my system so I can not test. Might be need to use double quotes or "\" try with small and unimportant files first !

Hope this helps
Volker
Leif Halvarsson_2
Honored Contributor

Re: How to concatenate and FTP

Hi

I am not sure what you want to do with the concatenated file but remote concatenating is possible with the append ftp command.

You have some files on your local host
(aaa, bbb, ccc) and want to concatenat them in one file on a remote host.

ftp remotehost

ftp> put aaa
ftp> append bbb aaa
ftp> append ccc aaa
ftp> bye

Now the local aaa,bbb,ccc files are concatenated in the file aaa on the remote host.

The disadvantage with this method is there is no easy way to split the files again.
harry d brown jr
Honored Contributor

Re: How to concatenate and FTP

Honestly I find it silly to WASTE resources on one side (HOST) to concatenate the file then FTP the file to a CLIENT then un-concatenate the file.

If those files are in a directory and all of those files need to be FTP'd, then use

MPUT *

If the files are say *.text or say bigfile* files, then

MPUT *.text

or

MPUT bigfile*


have you thought about "rcp"????


live free or die
harry
Live Free or Die
Chandrakumar Karunamoor
Occasional Advisor

Re: How to concatenate and FTP

Thank you for all you replies.

Volker, you are right. I have file1, file2, file3 on the host machine but do not want to waste time and resource to create fileCONCAT.

Leif, Thank you for you input.

Harry, i missed to say that i don't have to un-concatenate the file in the client/remote machine. Our requirement is such that we create more than one file for making use of parallel processing etc and the client needs just one file. I hope it is not silly asking this question for this requirement.

Thank you every one again.
Chandra