Operating System - HP-UX
1830898 Members
2784 Online
110017 Solutions
New Discussion

Re: Problem with cpio when I want to recover one file

 
Marcelo Polizzotto
Occasional Contributor

Problem with cpio when I want to recover one file

I want to recover one or one group of files from my cpio backup, that I did with this sentence:
find /backup -depth -print | cpio -ocvB > /dev/rmt/0m

but when I try with a sentence like this nothing happens
cpio -icdvB < /dev/rmt/0m /backup/file

Thanks a lot for your help !!

Marcelo
Oneself is the worse enemy
6 REPLIES 6
John Palmer
Honored Contributor

Re: Problem with cpio when I want to recover one file

Hi,

I'm no expert on cpio but I'd try:-

cpio -icdvB /backup/file < /dev/rmt/0m

Regards,
John
CHRIS_ANORUO
Honored Contributor

Re: Problem with cpio when I want to recover one file

[To vi and restore a home directory do: vi /tmp/chris; then input files required e.g. /home/hp/*
Command for restore :- cpio -ivdumB -E "/tmp/chris"
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Devbinder Singh Marway
Valued Contributor

Re: Problem with cpio when I want to recover one file

Have a look on the tape to see first how files are written ( from your command it should be absolute) i.e do
cpio -itvc
If absolute i.e. shows /filename/etc..

then do cpio -ivcdB "/backup/file"
(try inserting file name in double quotes )
Seek and you shall find
Al Langen
Advisor

Re: Problem with cpio when I want to recover one file

First of all, when using cpio, we avoid the use of the find command with leading '/' do to the problem of restoring the file to some other directory.

Next, we always use quotation marks (") around the name of an individual file. If we need to restore a directory, we use "somename/*" to restore the contents of the directory.

It's not the ups and downs in life, it's the jerks. A. E. Newman
Marcelo Polizzotto
Occasional Contributor

Re: Problem with cpio when I want to recover one file

Thanks for your help !!
As you received my points, you can see that I solve part of my problem, so the new question is:

How can I use cpio the way that you told me and download the file(s) to another directory or present directory, different from original

Thanks again
Marcelo Polizzotto
Oneself is the worse enemy
Dan Hetzel
Honored Contributor

Re: Problem with cpio when I want to recover one file

Hi,

If you solved your problem, then I believe that you should have assigned 8 to 10 points to all the guys who gave you the "magic answer" (all of them, in fact)

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com