Ontape and Shell Script

Ontape and Shell Script

Post by Terron Wrig » Sun, 31 Dec 1899 09:00:00



I am trying to run in a shell script and I wondering if there is a way
to make ontape skip the mount tape message. I was wondering if I could
be pipe ontape to a return command. Could someone shed a little light on
this subject if this is possible, please.

 
 
 

Ontape and Shell Script

Post by Nils Myklebu » Sun, 31 Dec 1899 09:00:00


Check the faq. It's in there.

:I am trying to run in a shell script and I wondering if there is a way
:to make ontape skip the mount tape message. I was wondering if I could
:be pipe ontape to a return command. Could someone shed a little light on
:this subject if this is possible, please.


NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway
My opinions are those of my company
The Informix FAQ is at http://www.iiug.org

 
 
 

Ontape and Shell Script

Post by Con Wooda » Sun, 31 Dec 1899 09:00:00



> I am trying to run in a shell script and I wondering if there is a way
> to make ontape skip the mount tape message. I was wondering if I could
> be pipe ontape to a return command. Could someone shed a little light on
> this subject if this is possible, please.

Terron,
We run a shell that does this by using an input file that has a couple of
new-line entries.  We call it archive.input.

The shell, run_arc.sh, contains the lines below looks.  It runs a level zero
without requiring a tape mount prompt.

run_arc.sh

ontape -s -L 0 < /inf_dir/bin/archive.input \
         >> /inf_dir/error/archive.out 2>> /object/error/archive.out

By running it with

nohup /inf_dir/bin/run_arc.sh &

You also free up the terminal you submit the archive on.
And you could put the running statment in a shell aas well.

We are currently on aix.3.2.5 with 7.11.uc1. od the Dynamic Server.

I would be cautious in trying to do this unattended.  The absence of
a mounted tape usually causes a large number of error messages to
the archive.out file and they will go on until some human stops it
or you fill some file system

Hope this helps.
--
Con Woodall Colorado St. U.; Veterinary Teach. Hosp.; Ft. Collins CO 80523,

"There is no 'maybe' in Boolean algebra."
--

 
 
 

Ontape and Shell Script

Post by Schneider Pete » Sun, 31 Dec 1899 09:00:00





> > I am trying to run in a shell script and I wondering if there is a way
> > to make ontape skip the mount tape message. I was wondering if I could
> > be pipe ontape to a return command. Could someone shed a little light
on
> > this subject if this is possible, please.

> Terron,
> We run a shell that does this by using an input file that has a couple of
> new-line entries.  We call it archive.input.

> The shell, run_arc.sh, contains the lines below looks.  It runs a level
zero
> without requiring a tape mount prompt.

> run_arc.sh

> ontape -s -L 0 < /inf_dir/bin/archive.input \
>          >> /inf_dir/error/archive.out 2>> /object/error/archive.out

Con (and Terron),
You can improve your shell script using the so called here-document, for
example:
ontape -s -L 0 <<END >>archive.out 2>>archive.out

END
All lines between "<<END" and the line starting with "END" are used as
stdin of  ontape. In our example there is only one NL, that's it.
So you can save the 2nd file (archive.input).