1847213 Members
2276 Online
110263 Solutions
New Discussion

cpio outpout

 
Kevin Mc Gettigan
Occasional Contributor

cpio outpout

I am verifying a tape using cpio and it is creating a 2.8Mb log file. Is there a switch on cpio I can use to display a summary of the dump, ie no. of file, no. of blocks, time taken, etc. to minimise the log file.
Cheers.
live the life you love, love the life you live
2 REPLIES 2
Dave Kelly_1
Respected Contributor

Re: cpio outpout

There's no summary available in cpio but you can use awk on the output, i.e.

time cat cpio.file | cpio -ictv | awk '{ numFiles++; numBlocks+=$3} END {printf("Files: %d\n Blocks: %d\n", numFiles, numBlocks}'

The time command will tell you how long it took, the awk script will tell you the number of files and the number of blocks.
Dave Kelly_1
Respected Contributor

Re: cpio outpout

Ignore the previous post, there is a missing bracket.


There's no summary available in cpio but you can use awk on the output, i.e.

time cat cpio.file | cpio -ictv | awk '{ numFiles++; numBlocks+=$3} END {printf("Files: %d\n Blocks: %d\n", numFiles, numBlocks)}'

The time command will tell you how long it took, the awk script will tell you the number of files and the number of blocks.