Re: Unattended ontape
Posted in 2004
Topics: Backup & Restore
Your comments are of course quite correct: this does not support multiple
tapes,
but is fine for smaller databases. Any error is recorded but the process
aborts.
Sounds like others are using "expect" for a more complete solution.
"Doug Lawry" <lawry@nildram.co.uk> wrote in message
news:c5on8e$iml$1@nntp0.reith.bbc.co.uk...
> 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"
We use a standard ksh script and, touch wood, it's fine. expect didn't
use to ship with Solaris and additional software wasn't allowed:-(
Doug Lawry wrote:
>
> Your comments are of course quite correct: this does not support multiple
> tapes,
> but is fine for smaller databases. Any error is recorded but the process
> aborts.
> Sounds like others are using "expect" for a more complete solution.
>
> "Doug Lawry" <lawry@nildram.co.uk> wrote in message
> news:c5on8e$iml$1@nntp0.reith.bbc.co.uk...
>
> > 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"
--
Paul Watson #
Oninit Ltd # Growing old is mandatory
Tel: +44 1436 672201 # Growing up is optional
Fax: +44 1436 678693 #
Mob: +44 7818 003457 #
www.oninit.com #