ontape in cron
Posted in 1999
Topics: Backup & Restore
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
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
Our SAP Basis administrator wrote a script that has ontape read a sequential
file and he echoes 'Y' into the file when the tapes have been switched.
gmurad@unimedsp.com.br wrote in message <7q6br4$3fq$1@news.xmission.com>...
>
> 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
>
>