output from cpio won't redirect to file
I have a backup script that works but I can't seem to get the output from the cpio command to go to a file.
cpio -ov -H odc <${file_list} | rsh prod dd of=/dev/rmt/0 obs=128k >> ${buday} The commands above and below this line are redirecting the output correctly. |
Are (some of) those messages written to stderr?
This might do the trick: cpio -ov -H odc <${file_list} | rsh prod dd of=/dev/rmt/0 obs=128k >> ${buday} 2>&1 |
What I am getting is the file names that are being backed up shown on the screen and I would like to capture them to a file. Currently, I am not rerouting any of the error messages.
|
You are rerouting ;)
The >> ${buday} part 'reroutes' stdout to a file. This is short for 1>> ${buday}. My guess was (and is) that the other messages are comming from stderr (which is normally send to your terminal), so that's why I suggested the 2>&1 addition. All comming from stderr is redirected to stdout, all comming from stdout is redirected to ${buday}. |
OK, I'll give it a try.
Thanks |
I did the
cpio -ov -H odc <${file_list} | rsh prod dd of=/dev/rmt/0 obs=128k >> ${buday} 2>&1 and added the ${buday} in between the cpio switchs and the <${file_list} and it now works. cpio -ov -H odc 2>>${buday}<${file_list} | rsh prod dd of=/dev/rmt/0 obs=128k >> Thanks for all you help Thanks for all your help. |
All times are GMT -5. The time now is 10:53 AM. |