1754843 Members
5232 Online
108825 Solutions
New Discussion юеВ

Newbie - CPIO question

 

Newbie - CPIO question

Hi i'm currently trying to redirect the blocksize output in a cpio script, so i can use it later on in the script.

I have tried a pipe into "tee" with no success.

Can anyone help please.

the syntax i have tried is

< file list> |cpio -oB > /dev/rmt/0m|tee /tmp/dat.log

3 REPLIES 3
Thierry Poels_1
Honored Contributor

Re: Newbie - CPIO question

hi,

< file list> |cpio -oB > /dev/rmt/0m 2> /tmp/dat.log

would do the trick. Note that this will send ALL errors to your log file.

good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Vincenzo Restuccia
Honored Contributor

Re: Newbie - CPIO question


< file list> |cpio -oB > /dev/rmt/0m 2>&1 > /tmp/dat.log
A. Clay Stephenson
Acclaimed Contributor

Re: Newbie - CPIO question

If you want to increase throughput on most tape devices you should increase the blocking as well by redirecting through yet another pipe.
After the cpio -oB add this pipe | dd ibs=5k obs=1000k of=/dev/rmt/0m. You will have to play with the output block size to optimize performance. You can still redirect the stderr from both cpio and the dd command to file(s) if you like. On a few tape drives the blocking will not matter but on most it will.
If it ain't broke, I can fix that.