RE: ontape in cron
Posted in 1999
We have been running our 'ontape' archives via cron for quite a while now.
We run them off to disk file(s), which then get backed up onto tape via the
normal system backup job(NetBackup). The "secret" to doing the multi-volume
archives is a utility program called "expect". We got it from Ready-to-Run
software, but it's probably available from many places, since it's "generic"
type utility software, like gzip. The key capability of "expect" is that it
can spawn a job (e.g., "ontape -s -L 0"), monitor the output of that job,
and send scripted responses back to the job (e.g., when the job asks for
another tape, link the TAPEDEV pointer to another file, and then send a C/R
to the job). We've got several of our "expect" scripts set up to start a
background compress of the volumes of the archive as they fill. We've also
built in error checking (instance is down, filesystem is full, etc.).
*** PLEASE, no comments/warnings/etc. about writing archives to disk -- I've
witnessed the battles in c.d.i., and this methodology works great for us,
including restores!
HTH,
Paul Mosser
Wells Fargo & Co.
-----Original Message-----
From: Art S. Kagel [mailto:kagel@bloomberg.net]
Sent: Friday, August 27, 1999 9:10 AM
To: informix-list@iiug.org
Subject: Re: ontape in cron
No way to do it, Gustavo. Ontape is interactive and is waiting for the
user to enter 'y'. Hmmmm. You could redirect stdout & stdin from/to a
pipe which is an application that opens a window on the operators console
and displays the ontape prompt, read from stdin, and accepts a reply from
the operator on ontape's behalf and writes it to stdout. Not pretty but
it should be doable. To do this the cron would run your terminal proxy
program which would create a bidirectional pipe and start ontape on that
pipe (actually a pair of pipes) for you. If you do not know how to setup
such pipes look at the source for my eventalarm.c in utils3_ak in the IIUG
Software Repository. Eventalarm uses this method to manage an ontape -a
session.
Art S. Kagel
gmurad@unimedsp.com.br wrote:
>
> I would like to run archive in cron, using the following script :
>
> echo "Backup Started "`date`>$LOGFILE
>
> echo "\\n0" | ontape -s -L 0 >>$LOGFILE 2>&1
> if [ $? -ne 0 ]
> then
> echo "Backup Failed "`date`>>$LOGFILE
> else
> echo "Backup Completed "`date`>>$LOGFILE
>
> fi
>
> The point is: my full archive requires two tapes; so how can i tell this
> background process to
> continue (it asks for an enter to switch tapes) when the operator put the
> other tape manually into the Unit? Is there a signal i could send to the
> process PID?
>
> TIA,
>
> Gustavo