Re: scipt to cron for tbtape
Posted in 1995
Luis Alejandro Mendoza Torres wrote:
>
> i need make cron to doing backup database on informix online 5.0
> with tbtape -s at level two on o.s. solaris 2.0/sun sparc 20.
>
> but tbtape need a return key and level parameter.
>
> does anybody have a script to help me?
>
> thanks.
>
> luis alejandro mendoza torres.
> 71430,1261@compuserve.com
> mexico,d.f.
> credimar,s.a. de c.v.
>
Luis,
Here's the script we run nightly from cron. Just call this script
from cron with an argument of the archive level you wish to run
(i.e. "archive.ksh 2" for a level two archive).
# @(#)archive.ksh v1.00 Shell Script to run level $1 Archive
#
# Define program CONSTANTS
INFORMIXDIR=/usr/informix; export INFORMIXDIR
echo "Archive Started -- `date`"
$INFORMIXDIR/bin/tbtape -s << EOF | head -150
$1
EOF
echo "Archive Completed -- `date`"
The blank line above the "$1" just contains a carriage return.
The "head -150" will terminate the command in case there is no
tape mounted when the cron job runs. Make sure that the argument
you give to "head" is bigger than the normal output of your
archive.
Good Luck!!
-Dave
-----------------------------------------------------------------+------------
_______ _______ _______ |
/\\ ____\\ /\\__ __\\ /\\__ __\\ David Buchholz |
\\ \\ \\___/ \\/_/\\ \\_/ \\/_/\\ \\_/ Database Administrator | Standard
\\ \\ \\____ \\ \\ \\ \\_\\ \\__ ConferTech International Inc. | Disclaimers
\\ \\______\\ \\ \\_\\ /\\______\\ Westerminster, CO. | Apply
\\/______/ \\/_/ \\/______/ datacop@cfer.com/(303)633-3089 |
|
-----------------------------------------------------------------+------------