O'Reilly logo

Practical UNIX by Steve Moritsugu - DTR Business Systems

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using cpio to Back Up and Restore Files

You will find that this section on cpio uses much of the same wording as in the previous section on tar. The two commands have similar functionality, and only some specific details and examples change the two sections. The tar and cpio sections are complete in themselves, without complicated references to one another, but if you read them both, you’ll get a strong sense of déjà vu.

Backing Up a Directory Subtree

cpio stands for copy in/out and it enables you to back up files to tape, disk, or a disk file. Here is an example of a basic cpio command to back up one complete directory:

$ cd /usr/fred/projects
$ find . -print | cpio -ocvaB > /dev/XXX?

First use cd to change the directory to back up. Then use ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required