cpio question

I apologize in advance if someone else has posted a similar question and I overlooked the answer in the forums, so here goes.

i'm using cpio to retrieve data from a tape and the switches i'm using are
cpio -AvicdumkB -I/dev/rct0

now the data i'm trying to restore is a specific couple of directories off of /u. I created a /tape directory under /u to put all the data from the tape into, so that went something like this.

pwd = /u
mkdir tape
chmod 777 tape (this is only a temp directory and only 1 person (me) has root access so 777 is ok for the permissions)
cd tape

Now what I would like to do is restore only a few directories form that tape and have them restored into the tape directory but i'm not familiar enough with the cpio command to change the switches that I currently use.

The directory structure that I would like to restore is set up like this:

/u/prd
/u/prd2
/u/prd3
and so on up to prd8

My question is, is there a way to use cpio to restore only the prd directories from the tape without having to restore the whole tape backup?
If it makes any difference, each prd directory contains only a single .dat file. Also, i'm running SCO 5.0.7 with mp3 installed.

Many thanks with any assistance you can provide in advance. I've tried reading the man pages for cpio and they read like stereo instructions.

I going to need to guess here because most cpio version do not have that A option. Good thing you have it though... it gives you a good shot at this. I look up that A on the SCO web site. It turns absolute paths into relative paths by removing the leading slash. If I read this right, you will wind up with /u/tape/u/prd and so on. Make sure you cd into /u/tape. Then you run your cpio command with patterns to match the directories you want to restore. The problem is that I don't know what you want to exclude. Is there a /u/prd9 and /u/prd10, etc? So to keep it simple just try this...

cpio -AvicdumkB -I/dev/rct0 u/prd u/prd2 u/prd3 u/prd4 u/prd5 u/prd6 u/prd7 u/prd8

I think this will work, but I have no way to test it. Let us know if it works ok.

I typed in the command as you had it in your response and it restored the directories but not the file in those directories. I even tried a variation of that command by putting the file name, so it looked something like this

pwd
/u/tape
cpio -AvicdumkB -I/dev/rct0 /u/prd/mumps.dat

but it only restored the directory so i'm kind of at a loss. I don't understand why it would go so far as to restore the directory but not the file. Any suggestions?

Notice that I had no leading slash on my patterns but you show a leading slash. Try:
cpio -AvicdumkB -I/dev/rct0 u/prd/mumps.dat

Didn't notice that you left out the leading slashes. Amazing how you manage to overlook the smallest things when you get used to doing things a certain way. I'll try it again w/out the leading slash. Thanks again for your time and assistance, I really do appreciate it.

I managed to figure it out. After creating the tape directory and trying a few different combinations of the switches I finally got it with using wildcards.

cpio -AvicdumkB -I/dev/rct0 u/prd*/MUMPS*

Mumps is the name of the file and it's extension is .DAT in the prd directory but it's .EXT in each subsequent directory so cpio will play nice with the wilcard.

Many thanks for pointing me in the right direction. I fear I would have been pulling my hair out trying to figure this out.

Hnelson