Automatic Backup Using ontape
Posted in 2005
A user on IDS 9.21/UnixWare 7.1.1 asked how to run unattended nightly ontape backups from cron. Several people supplied working recipes: the key trick is feeding ontape the carriage-return it waits for, e.g. piping an echo of a newline into "ontape -s -L 0" (or using a here-document with a blank line), redirecting output to a log file, and setting INFORMIXDIR, INFORMIXSERVER and ONCONFIG in the script. Suggestions also included pre-creating the backup file in the TAPEDEV path with 660 perms, gzip-ing the archive afterwards, checking tape readiness with tapecntl, and grepping the log for "100 percent done." or errors to verify success. Problem effectively resolved by these sample scripts.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Backup & Restore, Versions, Editions & End-of-Life
Hi
Can somebody help me setup an automatic backup using ontape. I want to =
schedule the backup to happen in the night without any user =
intervention.
Any exisiting script will surely help.
IDS=3D IDS 9.21
OS=3D Unixware 7.1.1
TIA
Avicha;
Avichal A
N.... wrote:
>Hi
>
>Can somebody help me setup an automatic backup using ontape. I want to =
>schedule the backup to happen in the night without any user =
>intervention.
>Any exisiting script will surely help.
>
>IDS=3D IDS 9.21
>OS=3D Unixware 7.1.1
>
>TIA
>
>Avicha;
>
>
>
>
>
>
>
Hi
use crintab and make a script with line
echo "\\
" | ontape -s -L 0 > $INFORMIXDIR/ont0.log 2>&1
you must chek for string "100 percent done." and error.
L0_OK=`grep "100 percent done." $INFORMIXDIR/ont0.log | wc -l`
L0_ERR=`grep -i error $INFORMIXDIR/ont0.log | wc -l`
Dimitar Bachvarov
On
Tue, Jul 05, 2005 at 07:48:47PM -0400, Avichal A N.... wrote:
> Hi
>
> Can somebody help me setup an automatic backup using ontape. I want to =
> schedule the backup to happen in the night without any user =
> intervention.
> Any exisiting script will surely help.
>
> IDS=3D IDS 9.21
> OS=3D Unixware 7.1.1
Try:
if tapecntl -w; then echo|ontape -s -L 0; fi
--
Dominik 'Chiron' Derlatka
GG: 1459829
JID: chiron (na) jabber.org
Something like this:
# begin of script
ontape -s -L 0 <<EOF 1>>your_log_file 2>&1
EOF
# Yes, leave a blank line after ontape!
# end of script
In case you backup to disk you can compress the archive file on the fly.
Regardz
-----Mensaje original-----
De: forum.subscriber@iiug.org [mailto:forum.subscriber@iiug.org] En
nombre de Avichal A N....
Enviado el: Martes, 05 de Julio de 2005 08:49 p.m.
Para: ids@iiug.org
Asunto: Automatic Backup Using ontape [5348]
Hi
Can somebody help me setup an automatic backup using ontape. I want to =
schedule the backup to happen in the night without any user =
intervention.
Any exisiting script will surely help.
IDS=3D IDS 9.21
OS=3D Unixware 7.1.1
TIA
Avicha;
AVISO LEGAL:
Esta informacion es privada y confidencial y esta dirigida unicamente a su
destinatario. Si usted no es el destinatario original de este mensaje y por
este medio pudo acceder a dicha informacion por favor elimine el mensaje. La
distribucion o copia de este mensaje esta estrictamente prohibida. Esta
comunicacion es solo para propositos de informacion y no debe ser considerada
como propuesta, aceptacion ni como una declaracion de voluntad oficial de
REPSOL YPF S.A. y/o subsidiarias y/o afiliadas. La transmision de e-mails no
garantiza que el correo electronico sea seguro o libre de error. Por
consiguiente, no manifestamos que esta informacion sea completa o precisa.
Toda informacion esta sujeta a alterarse sin previo aviso.
This information is private and confidential and intended for the recipient
only. If you are not the intended recipient of this message you are hereby
notified that any review, dissemination, distribution or copying of this
message is strictly prohibited. This communication is for information purposes
only and shall not be regarded neither as a proposal, acceptance nor as a
statement of will or official statement from REPSOL YPF S.A. and/or
subsidiaries and/or affiliates. Email transmission cannot be guaranteed to be
secure or error-free. Therefore, we do not represent that this information is
complete or accurate and it should not be relied upon as such. All information
is subject to change without notice.
echo
"0\\
\\
" | $INFORMIXDIR/bin/ontape -s
>From: "Avichal A N...." <avichal@cjpatel.com.fj>
>To: ids@iiug.org
>Subject: Automatic Backup Using ontape [5348] Date: Tue, 5 Jul 2005
>19:48:47 -0400 (EDT)
>
>Hi
>
>Can somebody help me setup an automatic backup using ontape. I want to =
>schedule the backup to happen in the night without any user =
>intervention.
>Any exisiting script will surely help.
>
>IDS=3D IDS 9.21
>OS=3D Unixware 7.1.1
>
>TIA
>
>Avicha;
>
>
>
I use
something like:
RETURN='\\
'
ontape -s -L 0 > /usr/informix/ontapeout.log 2>&1 | sleep 10 | echo
$RETURN
-----Original Message-----
From: forum.subscriber@iiug.org [mailto:forum.subscriber@iiug.org] On
Behalf Of chiron@meritus.pl
Sent: Wednesday, July 06, 2005 2:19 AM
To: ids@iiug.org
Subject: Re: Automatic Backup Using ontape [5352]
On Tue, Jul 05, 2005 at 07:48:47PM -0400, Avichal A N.... wrote:
> Hi
>
> Can somebody help me setup an automatic backup using ontape. I want to
=
> schedule the backup to happen in the night without any user =
> intervention.
> Any exisiting script will surely help.
>
> IDS=3D IDS 9.21
> OS=3D Unixware 7.1.1
Try:
if tapecntl -w; then echo|ontape -s -L 0; fi
--
Dominik 'Chiron' Derlatka
GG: 1459829
JID: chiron (na) jabber.org
Avichal,
## Fire off the script via Crontab.
## Set INFORMIXDIR, INFORMIXSERVER and PATH
## The second " is on a new line. In case off error
## this will stop messages after 100 lines.
## Credits to to some (forgot who) iiug member
echo "
"| ontape -s -L 0 | head -100 |tee your_archive.log
HTH,
Zev Berezin
Date sent: Tue, 5 Jul 2005 19:48:47 -0400 (EDT)
To: ids@iiug.org
From: "Avichal A N...." <avichal@cjpatel.com.fj>
Subject: Automatic Backup Using ontape [5348]
> Hi
>
> Can somebody help me setup an automatic backup using ontape. I want to =
> schedule the backup to happen in the night without any user =
> intervention.
> Any exisiting script will surely help.
>
> IDS=3D IDS 9.21
> OS=3D Unixware 7.1.1
>
> TIA
>
> Avicha;
>
>
>
>
1.-
Create Shell Script, with SERVERNAME, INFORMIXDIR, ONCONFIG variables.
INFORMIXSERVER=(Instance)
ONCONFIG=(onconfig file)
INFORMIXDIR=(pathname)
2.- Create backup filename in the same path than TAPEDEV variable of onconfig
file.
> /(Path)/backup
3.- change perms to rw-rw---- (660)
chmod 660 /(Path)/backup
4.- Execute ontape level 0 command. ( Non interactive way )
echo "\\
0" | $INFORMIXDIR/bin/ontape -s -L 0
5.- If you need keep space you can compress the file with gzip command
gzip /(Path)/backup
--- "Avichal A N...." <avichal@cjpatel.com.fj> escribió:
> Hi
>
> Can somebody help me setup an automatic backup using ontape. I want to =
> schedule the backup to happen in the night without any user =
> intervention.
> Any exisiting script will surely help.
>
> IDS=3D IDS 9.21
> OS=3D Unixware 7.1.1
>
> TIA
>
> Avicha;
>
>
>
>
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.yahoo.com.mx/