Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
In a thread on unattended ontape -r restores on IDS 7.31 Linux, David Williams listed the exit statuses of onstat - (-1 offline, 0 initialisation, 1 quiescent, 2 recovery, 3 backup, 4 shutdown, 5 online, 6 abort). S. Dhayanidhi posted a shell script that shuts down, restores with ontape and loops on engine status. Obnoxio The Clown joked about it.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Colin Bull — — source: Usenet: comp.databases.informix
Christian Knappke wrote
>
> "Colin Bull" <c.bull@videonetworks.com> wrote:
>
> > Here is one I prepared earlier ---
> >
> > onbar/ontape whatever ..
> > FORCEOL=n
> > until onstat - | grep "On-Line" > /dev/null
> > do
> > echo "Off line" # ; sleep 20
> > onstat - | grep "[BQ][lu][oi][ce][ks]" > /dev/null && ( echo
> > "\\nServ blokd"
> > if [ x$FORCEOL = "xn" ] ; then
> > echo "Onlining.." ; onmode -m ; FORCEOL=y;
> > sleep 240
> > else
> > echo "waiting to online " ; sleep 240
> > fi
> > )
> > onstat - # for comfort factor
> > sleep 60
> > done
> 'onstat -' sets the return code according to the server state ->
> no need for boll*cking greps...
>
> >From the top of my head:
> 255 = server is offline ("Shared memory not initialized...")
> 5 = online
> 4 = some error
> 0..3 = several other states like quiescent, blocked etc. (don't
> know exacly)
>
That will make it a lot tidier, should be able to use a case statement.
I will revise next week sometime.
Colin Bull
c.bull@videonetworks.com
sending to informix-list
↪ replying to Colin Bull
David Williams — — source: Usenet: comp.databases.informix
"Colin Bull" <c.bull@videonetworks.com> wrote in message news:btmcr4> That
will make it a lot tidier, should be able to use a case statement.
> I will revise next week sometime.
>
http://www.smooth1.demon.co.uk/ifaq06.htm#6.33
6.33 What status codes does onstat return?
On 21st May 1998 mdstock@informix.com (Mark D. Stock) wrote:-
As a point of interest, you can check the current mode of IDS by checking
the status ($?) after onstat -.
The values returned by 'onstat -' are:
a.. -1 Offline
b.. 0 Initialisation
c.. 1 Quiescent
d.. 2 Recovery
e.. 3 Backup
f.. 4 Shutdown
g.. 5 Online
h.. 6 Abort
> Colin Bull
> c.bull@videonetworks.com
>
> sending to informix-list
Here is my cute little code.. for unattended tape restore.
We do restore to our development everyday and it works fine.
# ------------------------------------------------------------------
echo " ********************************************"
echo " * Tape Restore Utility (For Single Tape ) *"
echo " ********************************************"
# ------------------------------------------------------------------
echo " "
echo " Press Enter to Continue or CTRL-C to Abort \\c"
read con
echo "Please wait Shutting Down Engine..."
echo "y\\ny\\n" | onmode -k
echo "\\nPlease wait Restoring..."
echo "\\ny\\nn\\nn\\nn\\n" | ontape -r
while true
do
engstatus=`onstat - | awk '{ print $5 } '`
case $engstatus in
*Fast) echo "Online Engine is Recovering...";
sleep 50;;
*On-Line) grantdba;
echo "Engine in Online Mode....Ready to Use...";
exit;;
*Quiescent) echo "Engine is Quescient mode... Making Online";
cd etc;
onmode -m;
cp onconfig.null onconfig;
ontape -s -L 0 -B prime;
cp onconfig.tape onconfig;
cd;;
*for) echo "Engine is Off Line.. Starting Engine";
oninit;
exit;;
*) echo "Cannot find Engine Status..";
exit;;
esacdone
S.Dhayanidhi wrote:
> Here is my cute little code..
Most people just show pictures of their kids. Still, if it makes you
happy...
--
"C'est pas parce qu'on n'a rien ' dire qu'il faut fermer sa gueule"
- Coluche
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.