ontape used in scripts
Posted in 1999
Topics: Backup & Restore, Server Administration
I have a few scripts to backup my informix database.
In script set as ALARMPROG in onconfig I have following sequence:
.
.
.
/usr/informix/bin/ontape -a <<EOF
n
EOF
.
.
.
and it works fine.
Another script, that I am planning to put into cron, has a very similar
sequence:
.
.
.
/usr/informix/bin/ontape -s -L 0 <<EOF
EOF
.
.
.
but it does'n work, because, in this second case, ontape seems not to
read this Return character before EOF. As I have notticed running it at
command line, it expects hitting Return key directly from keyboard.
Anybody knows what is going on?
Thanks for any advice...
Hello Andrzej,
the easiest way will be to write an "answer-file" with all the keystrokes
You will need
during executing ontape, instead of using the EOF-logic. I used this in
works fine.
Wolfgang
Andrzej Piotrowski <a.piotrowski@apexim.com.pl> schrieb in im Newsbeitrag:
374BA075.6B95EB45@apexim.com.pl...
> I have a few scripts to backup my informix database.
> In script set as ALARMPROG in onconfig I have following sequence:
> .
> .
> .
> /usr/informix/bin/ontape -a <<EOF
>
> n
> EOF
> .
> .
> .
> and it works fine.
> Another script, that I am planning to put into cron, has a very similar
> sequence:
> .
> .
> .
> /usr/informix/bin/ontape -s -L 0 <<EOF
>
> EOF
> .
> .
> .
> but it does'n work, because, in this second case, ontape seems not to
> read this Return character before EOF. As I have notticed running it at
> command line, it expects hitting Return key directly from keyboard.
> Anybody knows what is going on?
> Thanks for any advice...
Wolfgang Zager wrote:
>
> Hello Andrzej,
>
> the easiest way will be to write an "answer-file" with all the keystrokes
> You will need
> during executing ontape, instead of using the EOF-logic. I used this in
> works fine.
>
> Wolfgang
[cut]
Hmm, I have done it before with the same result. What version of IDS do
You have ? Could You send me exact fragment of Your script with this
answer-file?
A.P.
In article <374BA075.6B95EB45@apexim.com.pl>,
Andrzej Piotrowski <a.piotrowski@apexim.com.pl> wrote:
> I have a few scripts to backup my informix database.
> In script set as ALARMPROG in onconfig I have following sequence:
> .
> .
> .
> /usr/informix/bin/ontape -a <<EOF
>
> n
> EOF
> .
> .
> .
> and it works fine.
> Another script, that I am planning to put into cron, has a very similar
> sequence:
> .
> .
> .
> /usr/informix/bin/ontape -s -L 0 <<EOF
>
> EOF
> .
> .
> .
> but it does'n work, because, in this second case, ontape seems not to
> read this Return character before EOF. As I have notticed running it at
> command line, it expects hitting Return key directly from keyboard.
> Anybody knows what is going on?
> Thanks for any advice...
>
This happens because ontape -s, just like ontape -a, prompts you if you would
like to back up your current log. In the first case you reply: 'n'. But in
the second you don't enter anything. So your DB archive is already on tape
and the utility waits for your input about the logs.
Alex.
--
Before the accident, I even could not spell UNIX
--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---