[afnog] tar: Concatenate / Create from STDIN?

Begumisa Gerald M beg_g at eahd.or.ug
Tue Feb 28 18:24:29 EAT 2006


      On Mon, 27 Feb 2006, Brian Candler wrote:
    > The traditional utility which works this way is cpio. With the
    > appropriate flags you can make it create output which is compatible
    > with tar.

Wow.  I think that's what am looking for.  :-)

    > Read your own cpio manpage, but using FreeBSD 5.4 I can do something
    > like:
    >
    > cat <<EOF | cpio -o -H ustar | gzip -9 >foo.tar.gz
    > ./file1
    > ./file2
    > ./file3
    > EOF

I think this solves the entire problem - I'll just add the -c flag to gzip
and pipe the output to SSH - something like:

cat <<EOF | cpio -o -H ustar | gzip -9c | ssh ...
./file1
./file2
./file3
EOF

Looking nice.  Thanks!  I'm grateful.

    > cpio really is your friend here, as the output of find can be piped
    > directly to cpio (you can pre-filter it using awk or perl first if
    > you wish).

I developed a certain liking for AWK for quick and dirty scripts -
probably am just abit lazy at learning the traditional bash scripting
language.

Thanks a bunch.  I'll post a pointer to the scripts when done - just
in case anyone might want to take a look at them or find them useful.


Cheers,
Gerald



More information about the afnog mailing list