Ontape - In Shock !
Posted in 2000
Topics: Backup & Restore
Hi
I have been writing a wrapper script for ontape -c
in order to log to disk.
It all works well and is a robust little script
It works like this:
{Named PIPE1} --> STDIN ( ontape -c ) STDOUT ---> {Named PIPE 2}
Awk reads the named pipe 2 and feed commands into named
pipe 1. The only fly in the ointment it that when I kill
ontape with -9, it sends the text "Killed". Eveything else
I trap and act on .
'Killed' does not go to STDOUT OR STDERR! so I cannot trap it, so
I
cannot close out elegantly. Please tell me it does not write
directly to the tty device .... !!
If it does, how does it behave when started by cron ?
if [ -t 1 ] is true ?
I'm sure I am reinventing the wheel, but is there a better way ?
( We do not have expect, and I do not program in Perl yet )
regards
Graham Mitchell
In article <8pgdum$oih$1@news.xmission.com>,
gmitchel@ea-dc.dhl.com wrote:
>
> Hi
>
> I have been writing a wrapper script for ontape -c
> in order to log to disk.
>
> It all works well and is a robust little script
> It works like this:
>
> {Named PIPE1} --> STDIN ( ontape -c ) STDOUT ---> {Named
PIPE 2}
>
> Awk reads the named pipe 2 and feed commands into named
> pipe 1. The only fly in the ointment it that when I kill
> ontape with -9, it sends the text "Killed". Eveything else
> I trap and act on .
>
> 'Killed' does not go to STDOUT OR STDERR! so I cannot trap it,
so
>
When you do a "kill -9" it is the shell that is priting out "killed"
not the killed processes. Think about it, a kill signal is not
trapable by the process so how could it be printing out "killed"?
-jrg
Sent via Deja.com http://www.deja.com/
Before you buy.