Problem with "ontape -s" in IDS 11.0
Posted in 2009
User on RHEL 5.2 could run ontape -s manually but it failed ("could not write the archive tape") when called from a script/ESQL-C program. The cause: ontape is interactive and needs input/Return. Suggestions included ontape -d -s -L 0 (11.50), feeding it a here-document with blank lines (ontape -s << EOF ... EOF), prompting the user with read and passing the answer via here-doc, and driving ontape via a bidirectional pipe in C (see eventalarm.c in utils3_ak) or using Expect/TCL. Art Kagel also noted the preceding onmode -c and ontape -a are unnecessary. The here-doc approach worked in a shell script, but the poster's last message says he still couldn't get it working from an ESQL-C program via system(); no resolution for that is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Backup & Restore, Server Administration, Logging & Checkpoints
Am trying to do backup in IDS server. Its running on RHEL 5.2
To do a level 0 back up, i used the following stuffs:
onmode -c -> Checkpoint connections
ontape -a -> Automatic logical logs backup
ontape -s -> Full system archiveI issued the above 3 commands in command line. And it is working fine as
intended
When i tried to automate through an ec file, the first 2 commands(onmode -c
and ontape -a) are working fine.
But ontape -s just throws an error without proceeding further
I could see the log message as "could not write the archive tape"
Is it anything in setting the permissions?
Could anyone help me out?
This happen because ontape is interactive by default...
If your IDS are 11.50 , you can use :
ontape -d -s -L 0
If you are using previous version , try the sequence bellow, including blank
lines:
ontape -s -L 0 <<EOF
EOF
But , just make sure your TAPE are mounted...
--- Em sex, 6/2/09, LAKSHMI DEVI PALANISSAMY <lakshmidevip@hcl.in> escreveu:
De: LAKSHMI DEVI PALANISSAMY <lakshmidevip@hcl.in>
Assunto: Problem with "ontape -s" in IDS 11.0 [14792]
Para: ids@iiug.org
Data: Sexta-feira, 6 de Fevereiro de 2009, 16:38
Am trying to do backup in IDS server. Its running on RHEL 5.2
To do a level 0 back up, i used the following stuffs:
onmode -c -> Checkpoint connections
ontape -a -> Automatic logical logs backup
ontape -s -> Full system archiveI issued the above 3 commands in command line. And it is working fine as
intended
When i tried to automate through an ec file, the first 2 commands(onmode -c
and ontape -a) are working fine.
But ontape -s just throws an error without proceeding further
I could see the log message as "could not write the archive tape"
Is it anything in setting the permissions?
Could anyone help me out?
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
Just a note:
The onmode -c isn't required at all as ontape forces a checkpoint before
doing anything else anyway. The ontape -a isn't strictly required because
the archive you are taking will contain all activity to the point at which
it starts, so no logs are needed except those created after the archive.
That said, it will make it easier to use the previous archive as a backup
(along with the logs taken between the two archives) in case the archive
becomes unusable for some reason. At the end of the ontape -s it will
prompt you to backup any logical logs written during the archive.
Art
On Fri, Feb 6, 2009 at 1:38 PM, LAKSHMI DEVI PALANISSAMY <
lakshmidevip@hcl.in> wrote:
> Am trying to do backup in IDS server. Its running on RHEL 5.2
>
> To do a level 0 back up, i used the following stuffs:
> onmode -c -> Checkpoint connections
> ontape -a -> Automatic logical logs backup
> ontape -s -> Full system archive> I issued the above 3 commands in command line. And it is working fine as
> intended
>
> When i tried to automate through an ec file, the first 2 commands(onmode -c
> and ontape -a) are working fine.
> But ontape -s just throws an error without proceeding further
>
> I could see the log message as "could not write the archive tape"
> Is it anything in setting the permissions?
>
> Could anyone help me out?
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any entity
with which I am affiliated nor those of the entities themselves.
--00163646d97370a85a046245ae21
I have used "ontape -s -L 0". But still no use.
What u have mentioned is correct.
Since the informix utility ontape is interactive, i could nt use these
commands in my ec program.
Also i want to read the backup option from user rather than mentioning in the
command itself (-L 0)
Is there any option to make the command work interactively with user input?
> -----Original Message-----
> From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
> LAKSHMI DEVI PALANISSAMY
> Sent: Tuesday, February 10, 2009 2:26 PM
> To: ids@iiug.org
> Subject: Re: Problem with "ontape -s" in IDS 11.0 [14826]
>
> I have used "ontape -s -L 0". But still no use.
> What u have mentioned is correct.
> Since the informix utility ontape is interactive, i could nt use these
> commands in my ec program.
>
> Also i want to read the backup option from user rather than mentioning
in
> the
> command itself (-L 0)
>
> Is there any option to make the command work interactively with user
> input?
ontape -s by itself will ask for the backup level and wait for the userto confirm a tape (or other media) is ready. The -L is optional.
--EEM
>
>
>
************************************************************************
**
> *****
> Forum Note: Use "Reply" to post a response in the discussion forum.
Using "ontape -s" doesnt wait for inout from user.
If i give this command line, it works. Or else it is not working when being
invoked from a script or ec file
If you want to make ontape interactive in a script you'll have to do
something like this:
#!/usr/bin/ksh
echo "Enter the backup level (0, 1 or 2):"
read foo
ontape -s -L $foo
> -----Original Message-----
> From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
> LAKSHMI DEVI PALANISSAMY
> Sent: Tuesday, February 10, 2009 3:11 PM
> To: ids@iiug.org
> Subject: Re: RE: Problem with "ontape -s" in IDS 11.0 [14828]
>
> Using "ontape -s" doesnt wait for inout from user.
> If i give this command line, it works. Or else it is not working when
> being
> invoked from a script or ec file
>
>
>
************************************************************************
**
> *****
> Forum Note: Use "Reply" to post a response in the discussion forum.
I used that option too.
ontape -s -L $input >> /u/tmp/bkup.out
Doing so, just logged the message "Please mount tape 1 on /dev/tapedev and
press Return to continue ..." in bkup.out
But on the screen, i cudnt see any of the messages
> -----Original Message-----
> From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of
> LAKSHMI DEVI PALANISSAMY
> Sent: Tuesday, February 10, 2009 3:59 PM
> To: ids@iiug.org
> Subject: Re: RE: RE: Problem with "ontape -s" in IDS 11.0 [14831]
>
> I used that option too.
>
> ontape -s -L $input >> /u/tmp/bkup.out>
> Doing so, just logged the message "Please mount tape 1 on /dev/tapedev
and
> press Return to continue ..." in bkup.out
>
> But on the screen, i cudnt see any of the messages
>
Well duh. You redirected the out put to a file. Therefore you can't
see it, except in the file. If you want to see the output, you either
have to let it go to the screen, watch it from a different terminal
window or set the process in the background (extremely not recommended)
and watch the file.
Try this:
#!/usr/bin/ksh
read foo
ontape -s >> /u/tmp/bkup.out << ENDER
$foo
ENDER
That will provide the "Press Return" to start executing the backup.
There really are 2 blank lines after $foo. In another window you can:
tail -f /u/tmp/bkup.out
Note that output that would have gone to the seen on the screen is
written to the file in blocks. So you'll probably see:
Informix backup beginning...
Please enter the level of archive to be performed (0, 1, or 2)
Please mount tape 1 on /dev/rmt/c2t3d0BEST and press Return to continue
...
Until the backup completes, when the rest of the file will be written.
A better idea would be to just allow the output to go to the screen and
capture the screen output to a file. I did it once about a year ago,
and I seem to remember having to create a fifo buffer. Unfortunately,
that script is long gone and I don't remember much more than that.
You'll need to do some research to make it happen.
--EEM
>
>
************************************************************************
**
> *****
> Forum Note: Use "Reply" to post a response in the discussion forum.
It IS possible to drive ontape from a 'C' program. See the example file
eventalarm.c in my ALARMPROGRAM package: utils3_ak in the IIUG Software
Repository. It contains a C routine that's used to parse the output from
ontape and it opens ontape in a bidirectional pipe.
A better and easier choice, however, would be to get and install TCL and
Expect. Expect is a scripting language build over TCL (Tool Control
Language) especially for writing control scripts for other applications.
Writing an interactive controller for ontape using TCL or even easier Expect
is very simple.
Art
On Tue, Feb 10, 2009 at 3:26 PM, LAKSHMI DEVI PALANISSAMY <
lakshmidevip@hcl.in> wrote:
> I have used "ontape -s -L 0". But still no use.
> What u have mentioned is correct.
> Since the informix utility ontape is interactive, i could nt use these
> commands in my ec program.
>
> Also i want to read the backup option from user rather than mentioning in
> the
> command itself (-L 0)
>
> Is there any option to make the command work interactively with user input?
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Art S. Kagel
Oninit (www.oninit.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Oninit, the IIUG, nor any other organization
with which I am associated either explicitly or implicitly. Neither do
those opinions reflect those of other individuals affiliated with any entity
with which I am affiliated nor those of the entities themselves.
--001636427377dbd86b046298014e
It worked out well in scripts:
I used:
ontape -s >> bkup.out <<ENDER
$ans
ENDER
I tried to implement the same for an ec program and ended up in vain
I used the following command:
"ontape -s -L 0 > bkup.out <<!\\
\\
!"
I passed this as argument to system command, but it didnt work out.
Any suggestions!!!!!!!