[Solved] CPIO --no-absolute-filenames


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [Solved] CPIO --no-absolute-filenames
# 1  
Old 02-21-2012
[Solved] CPIO --no-absolute-filenames

I succesfully created a backup script that creates CPIO archives preserving access times and etc. I orginally created the CPIO archives using the absolute paths.

Code:
find / -depth | grep -f include| cpio -oavc | gzip > archive.cpio.gz

I am trying to extract a cpio archive into a temp directory to check to make sure things are backing up and things are ok but am having trouble because it complains about permissions and will not restore in the current directory. So

Code:
mkdir /home/testuser/extract
cd /home/testuser/extract
user@extract>gunzip archive.cpio.gz
-rw-rw-r-- 1 tester testuser 1314521600 2012-02-21 13:21 archive.cpio
user@extract>cpio -i --no-absolute-filenames < 10.7.0.180.cpio
cpio: var/lib/dpkg/info/libgnome-bluetooth7.md5sums: Cannot open: Permission denied
cpio: var/lib/dpkg/info/humanity-icon-theme.postrm: Cannot open: Permission denied
cpio: var/lib/dpkg/info/libmono-system2.0-cil.md5sums: Cannot open: Permission denied
cpio: var/lib/dpkg/info/telepathy-butterfly.preinst: Cannot open: Permission denied
cpio: var/lib/dpkg/info/ufw.md5sums: Cannot open: Permission denied
cpio: var/lib/dpkg/info/tsconf.list: Cannot open: Permission denied
cpio: var/lib/dpkg/info/acpid.md5sums: Cannot open: Permission denied
cpio: var/lib/dpkg/info/libstdc++6.shlibs: Cannot open: Permission denied
cpio: var/lib/dpkg/info/libavc1394-0.postinst: Cannot open

????

---------- Post updated at 04:50 PM ---------- Previous update was at 04:36 PM ----------

I had an IDIOT moment:

Code:
cpio -idmv --no-absolute-filenames < 10.7.0.180.cpio

-i extract
-d create leading directories where needed
-m retain previous file modification times when creating files
-v verbose

Last edited by radoulov; 02-21-2012 at 06:19 PM.. Reason: Marked as solved.
# 2  
Old 02-21-2012
Thanks for letting us know the 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. Shell Programming and Scripting

Show only the filenames under a directory without relative and absolute paths.

I am able to list all the filenames under a directory & its sub-directories except blent.tar on Linux find "/tmp/" -type f | grep -v blent.tar | rev | cut -d '/' -f1 | rev Desired Output: THIRDPARTYLICENSEREADME.txt javaws libjavaplugin_oji.so libjavaplugin_oji.so... (3 Replies)
Discussion started by: mohtashims
3 Replies

3. Solaris

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 #cpio -ivBcdmu < xx.cpio but data from cpio not... (3 Replies)
Discussion started by: infjustice
3 Replies

4. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 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 Advanced & Expert Users

CPIO related

i have a cpio.z file containing another cpio file . I want to view the contents of the cpio file inside . How to do it? my parent cpio file invoked with cpio -itv looks some thing like ompmum4 sbadgire> zcat 210_2122_ECP_03.cpio.Z| cpio -itv -rwxr-xr-x 1 20519 20519 761856... (1 Reply)
Discussion started by: rraajjiibb
1 Replies

8. UNIX for Dummies Questions & Answers

backup with CPIO

Hi All, I have a tape backup(DDS2) with cpio. I want to restore just some directory from this device but I do not know the command ?? other question what is the best cpio command to take more than 8 GB data ? thanks Alice (1 Reply)
Discussion started by: alisevA3
1 Replies

9. 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

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