Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listing Tape Contents

Status
Not open for further replies.

bambock

Programmer
Oct 26, 2005
60
US
Does anyone know if it's possible to list the first N items of a tape using cpio -t? Depending on the day of the backup the relative path may be "/" down versus "/docs".

It would be great to list the first 10 items without spinning through the entire tape. Also, I'd like to script this, so it wouldn't be required to CTRL-C to end the process after the tape content starts spewing out.

Any thoughts?

Thanks,
Ethan
 
Messy but perhaps take the process id of the cpio -t and kill it after a certain number of seconds (experiment to find out how long it typically takes to give the the first listings) - a kind of self-aborting script.

The internet - allowing those who don't know what they're talking about to have their say.
 
That's what I thought, it was a little messy. I found a work around though; I check the restored contents for the child directory that I'm expecting and "cd" if necessary.

Thanks for the feedback.

Ethan
 
I'd do a "dd read" of a number of blocks from the tape and pipe that to cpio...

HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top