![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SCO UNIX tape restore | canbe842 | SCO | 5 | 09-16-2008 08:15 PM |
| Restore a tape | lo-lp-kl | AIX | 1 | 06-07-2007 06:22 PM |
| Backup Tape Restore? | bake255 | HP-UX | 5 | 08-16-2006 06:56 AM |
| Restore to disk from tape | mtoombs | Filesystems, Disks and Memory | 1 | 04-30-2004 11:26 AM |
| cpio restore - relative pathname | sureshy | UNIX for Dummies Questions & Answers | 4 | 08-27-2002 06:28 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
Selective restore from a cpio tape archive
Hi,
I use following command to restore data from my cpio tape archive: $cpio -icvd < /dev/rct0 But this'll restore all tape contents to the current path, what if I want only selected files from the tape, suppose I want /home/compdir/home2/Rev83/data/PL/01/*.* files to be restored from tape archive to my current path only, nothing else, which command I should use to achieve this? Any help would be highly appreciated. Thnx & Rgrds, Tayyab |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
You can simply specify extraction patterns to cpio, but I prefer to use pax when redirecting a restoration....
You'll have to adjust this to your specific circumstances, but say I have a cpio archive, /var/tmp/tmp.cpio (this could just be your tape device), and I want to restore /home/zb/tmp/*something* to /var/tmp/output... then I'd do... Code:
pax -r -s ',^/home/zb/tmp/,/var/tmp/output/,' -f /var/tmp/tmp.cpio "*something*" If you don't have pax installed, tell us which OS you're using. And... if you don't actually want to redirect output, just specify the pattern to cpio, something like: Code:
cpio -icvd "*somepattern*" < input_archive ZB |
|
#3
|
||||
|
||||
|
Hi,
Thnx for the reply. I tried pax with following paramters: Code:
# pax -r -s ',^/home/compdir/home2/Rev83/data/PL/01,/home/temp,' -f /dev/rct0 "*PL*" UX:pax: WARNING: /dev/rct0 : This doesn't look like a tar archive UX:pax: WARNING: /dev/rct0 : Skipping to next file... UX:pax: ERROR: *PL* not found in archive Code:
#cpio -icvd "home/compdir/home2/Rev83/data/PL/01/*.*" < /dev/rct0 Pls advise. Rgrds, Tayyab |
|
#4
|
||||
|
||||
|
With the cpio command, you probably need to include the leading "/" in the pattern name, otherwise it will not match any files in the archive.
Unfortunately I'm at home at the moment so do not have access to a tape drive to test pax reading from cpio archives stored on tape - on my Linux box at home it can read a cpio archive file ok. Which OS are you using? EDIT: with the pax command, try something like this Code:
# pax -r -s ',^/home/compdir/home2/Rev83/data/PL/01,/home/temp,' "*PL*" < /dev/rct0 ZB Last edited by zazzybob; 04-23-2006 at 06:46 AM. |
|
#5
|
||||
|
||||
|
my dear thnx for your prompt reply, but still no joy.
Code:
# pax -r -s ',^/home/compdir/home2/Rev83/data/PL/01,/home/temp,' "*PL*" < /dev/rct0 UX:pax: WARNING: - : This doesn't look like a tar archive UX:pax: WARNING: - : Skipping to next file... UX:pax: ERROR: *PL* not found in archive Code:
# cpio -icvd "/home/compdir/home2/Rev83/data/PL/01/*.*" < /dev/rct0 thnx & rgrds, Tayyab |
|
#6
|
||||
|
||||
|
Out of interest - do all the filest that you're trying to restore have a period ( . ) in them?
Cheers ZB |
|
#7
|
||||
|
||||
|
Yeah, all files have . in names like:
Code:
# ls 01.PL.accts 01.PL.apymt 01.PL.balnc 01.PL.ctrls 01.PL.ptext 01.PL.accts.ir 01.PL.atran 01.PL.baxbf 01.PL.dfpst 01.PL.systm 01.PL.accts.wd 01.PL.atype 01.PL.cpdoc 01.PL.histr 01.PL.trans 01.PL.accts.wi 01.PL.ausig 01.PL.ctgry 01.PL.paymt |
||||
| Google The UNIX and Linux Forums |
| Tags |
| cpio, linux |
| Thread Tools | |
| Display Modes | |
|
|