About cpio command


 
Thread Tools Search this Thread
Operating Systems Solaris About cpio command
# 1  
Old 11-08-2012
About cpio command

i need to extract cpio file archived full path to /restore/ (not full path or fullpath under this directory ) i can't find option for cpio please help me
example.
i have cpio file archive /etc/* and i need to extract file to /restore
Code:
#cpio -ivBcdmu < xx.cpio

but data from cpio not restore in /restore but restore in real path

i want to restore at /restore such /restore/etc/*


thank you

Last edited by Scott; 11-12-2012 at 04:08 AM.. Reason: Code tags
# 2  
Old 11-09-2012
Unfortunately it appears that the archive was created with absolute paths and cpio has no mechanism for modifying the path when restoring.

However the pax utility understands cpio archives and should be able to do what you want to do using the -s option.
# 3  
Old 11-11-2012
If listing the cpio archive shows filenames begining / then it was created with absolute pathnames. Not a good idea for flexability.

I think your only option for restoring it to a different path is to preceed the cpio restore command with a chroot to the directory you wish to restore to. You may need to manipulate the path to find the cpio command.

I've never done this under Solaris so let's invite comments from the community. Anyone out there done this?
# 4  
Old 11-12-2012
Quote:
Originally Posted by hicksd8
I think your only option for restoring it to a different path is to preceed the cpio restore command with a chroot to the directory you wish to restore to.
It is not the only option. Have a closer look at fpmurphy's answer, pax is much simpler a solution.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Cpio - input files (from list) are stored in different order inside cpio archive - why?

Due to budget constraints I have to reinvent an Enterprise backup system in a SPARC (sun4v) Solaris estate (10 & 11). (yep - reinvent wheel, fun but time consuming. Is this wise?! :confused: ) For each filesystem of interest, to try to capture a 'catalog' at the front of each cpio archive (for... (1 Reply)
Discussion started by: am115998
1 Replies

2. Debian

CPIO with Ubuntu

Hi, i am new here, and i have a question about cpio. i have a scsi traban tape drive, and i will restore some files and directories. Did anybody knows the instructions with cpio? regards Harald (1 Reply)
Discussion started by: gernsemer
1 Replies

3. UNIX for Dummies Questions & Answers

Using cpio with the find command

Hey everyone, I’ am a newbie to Unix. Learning some of the basic commands. I did some piping before like who | wc I wanted to practice some backup features in Unix. I’ am practicing using cpio and place it into a file named backup. I’m not quite sure where I’ am going wrong? ... (1 Reply)
Discussion started by: fox987
1 Replies

4. UNIX for Dummies Questions & Answers

advantages of cpio command?

hi, can any body tell me the advantages of having cpio command over tar command (7 Replies)
Discussion started by: prasannak
7 Replies

5. HP-UX

Please help with cpio on HP-UX

Hello all ... I am an Oracle DBA that got stuck in a HP-UX SA role and need some help figuring out a UNIX problem. According to Oracle documentation, I am to issue the following command ... cpio -idcmv <file_name> However when I do, the server just hangs there and does nothing til I... (3 Replies)
Discussion started by: soestx
3 Replies

6. UNIX for Dummies Questions & Answers

cpio

Hello, how can I restore files from a DAT using CPIO ? If I make : # mkdir save # cd /save # cpio -icumvdB </dev/rct0 Does the archive restore only in the directory /save ? And how can I restore a specified file from the DAT with the cpio command ? How can I know the size of the... (2 Replies)
Discussion started by: kok
2 Replies

7. UNIX for Dummies Questions & Answers

Restoring a directory using cpio command?

I am confused with how to restore archives. I just figured out the use of tar, but now after trying it with cpio, I'm unsure of some things. Firstly, is it necessary to cd to the directory you will be restoring to in order to run this command? Secondly, what is it I'm doing wrong when trying to... (2 Replies)
Discussion started by: Relykk
2 Replies

8. UNIX for Dummies Questions & Answers

Help with cpio

Hi all, Please help me with the extraction of files from a cpio. what I mean is basically I have received a file from someone i.e rooh.cpio. this file rooh.cpio contains various files in it. I want to know how I can extract the files and copy them to a different directory . Your quick... (2 Replies)
Discussion started by: rooh
2 Replies

9. UNIX for Dummies Questions & Answers

cpio command with compress

Hi friends.. I want to be able to copy a file from one location to another (locally). The location the files are copied to should have compressed instances of the files they were copied from. copy from /home/user/test.file copy to /backup/user/test.file.Z I need to be able to do this... (1 Reply)
Discussion started by: sureshy
1 Replies

10. UNIX for Dummies Questions & Answers

cpio

by mistake I deleted all the files in /usr2/symix/users/wfpsys/tpsc/ directory. full backup has taken yesterday using "CPIO" command and I am able to view the files from tape also using cpio command. but i couldn't able to restore back the files. Can you please help me immeditely by giving the... (2 Replies)
Discussion started by: wipro fluid power
2 Replies
Login or Register to Ask a Question