[lug] cpio

D. Stimits stimits at attbi.com
Thu Apr 10 15:32:36 MDT 2003


Robert wrote:

> On Tue, 2003-04-08 at 19:08, Bear Giles wrote:
>
> >Robert wrote:
> >
> >>On Mon, 2003-04-07 at 20:38, Bear Giles wrote:
> >>
> >>>>"cpio: premature end of file"
> >>>
> >>>You need to either use
> >>>
> >>> find ... -print0 | cpio -oA0 ...
> >>>
> >>>or
> >>>
> >>> find ... -print | cpio -oA ...
> >>>
> >>>The former is preferred since it will handle files with embedded
> >>>spaces.
> >>
> >>  I tried both, the first results in the same error, the second brings
> >>up the MAN cpio page, indicating incorrect syntax.
> >
> >I just verified that both forms worked on my system, esp.
> >
> >   find /etc -print0 | cpio -o0F foo
> >   find /dev -print0 | cpio -o0AF foo
>
>
>   Hi Bear,
>     Your example works fine as I already know, but your example does not
> duplicate the syntax of my original question.   What you did was back up
> an entire directory, which I have no trouble with either.
> Try this instead:
>
> cd into a directory of your choice.
> pick some file you don't care about, maybe a *.bak or whatever.
> Now, using find, pipe that file into cpio so it archives it into your
> archive file called "foo".
> Try that and see how it works.  Once again, I can't find the correct
> cpio syntax to append a file to a single archive file.
>
>
>
> >Meanwhile, at the risk of having you mocked on this list for
> >months >:-)~, you have verified that the cpio archive you're
> >appending to is a valid cpio archive, right?
>
>
>  cpio created the file, not me...
>
I use something like this:
find /SomeSource -print -xdev | cpio -pdm SomeDestination

This in turn could be piped to something like "tar -cvf NewTarName.tar", 
or else appended to an existing tar with something like "tar -vf 
ExistingTarName.tar --append". I haven't actually bothered to connect 
the tar and cpio command, but it is probably close to what is being 
requested.

D. Stimits, stimits AT attbi DOT com




More information about the LUG mailing list