Mailinglist Archive: opensuse (4749 mails)

< Previous Next >
Re: [SLE] cpio and tar
  • From: Anders Karlsson <anders@xxxxxxxxxxxx>
  • Date: 29 May 2003 11:54:46 +0100
  • Message-id: <1054205686.2138.12.camel@xxxxxxxxxxxxxxxx>
On Thu, 2003-05-29 at 11:26, Rohit wrote:
> Hi,
>
> I have been using tar/pkzip/winzip etc all my life. What is cpio? I see
> the man page and I fail to visualise the situations in which I might end
> up needing cpio.

cpio is more robust than tar, i.e. it is easier to recover from an error
in the archive. I tend to use cpio when I want to copy the contents of a
directory structure from one place to another and keep all ownership and
permissions intact on the files and directories copied.

Example:

/home is getting full, you have a new partition ready. mounted on /mnt
where all the data is being copied to.

cd /home ; find . | cpio -pdumvB /mnt

When command completes, you have a perfect copy of /home in /mnt.

> Can a user please throw some light on it?

man page should give some idea about what cpio is capable of. If that is
not enough, a few searches on google should give more details. cpio is
frequently used for backing systems up to tape, like tar, dump and
backup is.

HTH,

--
Anders Karlsson <anders@xxxxxxxxxxxx>
Trudheim Technology Limited
< Previous Next >
Follow Ups
References