Re: Unattended ontape
Posted in 2004
Topics: Backup & Restore
Doug Lawry wrote:
> Some recent threads implied that you cannot use ontape unattended.
> I disagree! See Shell script below.
>
> Regards,
> Doug Lawry
> www.douglawry.webhop.org
>
>
> # Run an automated Informix "ontape" backup
>
> # Doug Lawry, 20/11/95
>
> case $1 in
> '') set -- 0 ;;
> [012]) ;;
> *) echo "Usage: $0 level (0-2)" ; exit 1 ;;
> esac
>
> AWK='NF > 0 && $0 != last {print ; last = $0}'
>
> exec echo | ontape -s -L $1 | tr '\\b' '\\n' | awk "$AWK"
Interesting. Perfectly feasible as long as all the data always fits
onto one backup device. Not sufficient for the more general case
(larger database) where several backup devices are needed. If you're
clever, you can use 'expect' to drive it more intelligently.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
I thought unattended anything was expressly discouraged with ontape?
What if you get an error message, what if it needs to issue you with a
prompt you weren't expecting, etc.
Andy
Jonathan Leffler <jleffler@earthlink.net> wrote in message news:<VT4gc.13917$A_4.13712@newsread1.news.pas.earthlink.net>...
> Doug Lawry wrote:
> > Some recent threads implied that you cannot use ontape unattended.
> > I disagree! See Shell script below.
> >
> > Regards,
> > Doug Lawry
> > www.douglawry.webhop.org
> >
> >
> > # Run an automated Informix "ontape" backup
> >
> > # Doug Lawry, 20/11/95
> >
> > case $1 in
> > '') set -- 0 ;;
> > [012]) ;;
> > *) echo "Usage: $0 level (0-2)" ; exit 1 ;;
> > esac
> >
> > AWK='NF > 0 && $0 != last {print ; last = $0}'
> >
> > exec echo | ontape -s -L $1 | tr '\\b' '\\n' | awk "$AWK"
>
> Interesting. Perfectly feasible as long as all the data always fits
> onto one backup device. Not sufficient for the more general case
> (larger database) where several backup devices are needed. If you're
> clever, you can use 'expect' to drive it more intelligently.
which is exactly why ontape is a script is not supported!!
andykent.bristol1095@virgin.net (Andy Kent) wrote in message news:<ac5fb36.0404190013.5203a518@posting.google.com>...
> I thought unattended anything was expressly discouraged with ontape?
>
> What if you get an error message, what if it needs to issue you with a
> prompt you weren't expecting, etc.
>
> Andy
>
> Jonathan Leffler <jleffler@earthlink.net> wrote in message news:<VT4gc.13917$A_4.13712@newsread1.news.pas.earthlink.net>...
> > Doug Lawry wrote:
> > > Some recent threads implied that you cannot use ontape unattended.
> > > I disagree! See Shell script below.
> > >
> > > Regards,
> > > Doug Lawry
> > > www.douglawry.webhop.org
> > >
> > >
> > > # Run an automated Informix "ontape" backup
> > >
> > > # Doug Lawry, 20/11/95
> > >
> > > case $1 in
> > > '') set -- 0 ;;
> > > [012]) ;;
> > > *) echo "Usage: $0 level (0-2)" ; exit 1 ;;
> > > esac
> > >
> > > AWK='NF > 0 && $0 != last {print ; last = $0}'
> > >
> > > exec echo | ontape -s -L $1 | tr '\\b' '\\n' | awk "$AWK"
> >
> > Interesting. Perfectly feasible as long as all the data always fits
> > onto one backup device. Not sufficient for the more general case
> > (larger database) where several backup devices are needed. If you're
> > clever, you can use 'expect' to drive it more intelligently.