Informix's dbstart.informix.sh and infback.sh scripts

Automating Informix Startup: the dbstart.informix.sh Script

To Oracle DBAs: You will miss Oracle's oratab file; there is no similar file in Informix.

Not having a global configuration file makes a lot of things more difficult, one of them being backups.  When writing a shell script to back up all Informix instances on a given machine, how do you know what instances to back up?  You can't ask Informix, which definitely does not know about the other instances.  I would like to suggest a different method of starting Informix that would also make backups easier.  Let's start with the basics.

In order for an Informix database to be started up after a system reboot, a startup script must be placed somewhere in /etc.  Startup scripts are run by root, and therefore should be owned by root and placed in a directory that root controls.  A startup script in /etc should not be calling a startup script in informix's home directory.  However, this creates an extra task for both the SAs and DBAs.  The DBA must find a SA every time he wants to add a new instance to the startup script.  The SAs would rather not have to do this, but they don't want root running shell scripts found in informix's home directory.  The SAs are also normally in charge of backups, and this is one way to find out that there is a new instance to back up.

How does Oracle accomplish this task?  It's as simple as the oratab file. The start-up scripts are in a directory owned by root, and the oratab file is in a directory owned by the oracle ID.  The start-up script starts up any instances in the oratab file that have a "Y" in the third field.  All a DBA needs to do to have a new instance started is add the instance to that the oratab file.  This also gives backup scripts a great place to start.  For example, the oraback.sh utility automatically backs up any instances that it finds in the oratab file.

Sure, it's possible for a DBA to create and start up a new instance that does not get put into the oratab file.  However, if the oratab file is being used to both start up and back up Oracle, DBAs will get into the habit of putting new instances there.  Otherwise, they will continually have to start the instances manually and the instances will also never get backed up.  

With a little practice, Informix DBAs can be shown to do the same thing that Oracle DBAs do with the oratab file…   I present the inftab file, an Informix version of Oracle’s oratab file.

The inftab File

This inftab file in Figure 13-1 has several comments, but only one actual configuration line.  This line tells the startup scripts that there is an Informix instance called "crash," that its $INFORMIXDIR is /informix, and that it should be restarted after a reboot.  Its logical logs should go to /informix/logical.  (The logical backup destination variable will be used for the backup scripts that are covered later in this chapter.)

#  This file is used by the startup, shutdown and backup scripts
#  Provided in "Unix Backup & Recovery," O'Reilly & Assoc., Inc.
#
#  Author: W. Curtis Preston
#
#  Use a colon, ':', as the field terminator
#  Lines that begin with a octothorpe, or pound sign, (#) are comments.
#
#  Entries should follow this form:
#      $ONCONFIG:$INFORMIXDIR:<N|Y>:
#
#  The first field is the Informix Server name
#  The second field is the INFORMIXDIR variable that the Informix server uses
#  A Y in the third field indicates if this instance should be started
#  automatically after a system reboot.
#  The fourth field is where logical logs will go.  If you want to go
#  to disk, put a directory name.  If you want to go to tape, put the
#  device file of the tape drive here.
#
#  Multiple lines with the same $ONCONFIG variable are not allowed.
#
crash:/informix:Y:/informix/logical

Figure 13-1: A sample inftab file

The dbstart.informix.sh script in Figure 13-2 acts very much like Oracle's dbstart script (see Chapter 14).  It starts by reading the inftab file to determine the names of all instances.  Then it either starts or stops each of the instances that have a Y specified in the third field.  It also calls rclogs.sh for each of those instances.  Rclogs.sh, discussed later, automatically starts continuous backups in the background.

#!/bin/sh
#

INFTAB=/informix/etc/inftab

Usage()
{
 echo "Usage: [dbshut|dbstart] [start|stop]"
 echo "\n(Either this script must be called with the name of dbshut or dbstart,"
 echo "or it must be called with a start or stop argument.)"
 echo "\nIf called by the name dbstart, or with the argment of 'start,'"
 echo "it will start all Informix instances listed in $INFTAB"
 echo "\nIf called by the name dbshut, or with the argument of 'stop,'"
 echo "it will STOP all Informix instances listed in $INFTAB."
}
 

#This script starts up all instance on this box specified in $INFTAB
#It is of the form:
#$ONCONFIG:$INFORMIXDIR:<Y|N>

SCRIPT=`basename $0`

if [ $SCRIPT != dbstart -a "$1" != start ] ; then
 if [ $SCRIPT != dbshut -a "$1" != stop ] ; then
  Usage
  exit
 fi
fi

WHO=`id | awk -F'(' '{print $2}' | awk -F')' '{print $1}' `

if [ "$WHO" = root ] ; then
  su informix -c $0 $*
  exit $?
fi

grep -v '^#' $INFTAB \
|while read LINE
do

 STARTUP=`echo $LINE|cut -d: -f3`
 TBCONFIG=`echo $LINE|cut -d: -f1`
 ONCONFIG=`echo $LINE|cut -d: -f1`
INFORMIXDIR=`echo $LINE|cut -d: -f2`
 #INFORMIXSERVER and ONCONFIG can be different, so get it from the onconfig file
 INFORMIXSERVER=`grep DBSERVERNAME $INFORMIXDIR/etc/$ONCONFIG|awk '{print $2}'`

 BINDIR=$INFORMIXDIR/local/bin
 PATH=$INFORMIXDIR/bin:$BINDIR:$PATH
 export TBCONFIG ONCONFIG INFORMIXSERVER INFORMIXDIR PATH BINDIR

 if [ `basename $0` = dbstart -o "$1" = start ] ; then
  if [ "$STARTUP" = "Y" ] ; then
   echo "Starting Informix Instance $ONCONFIG"
   oninit
   [ -f $BINDIR/rclogs.sh ] && rclogs.sh start
  else
   echo "NOT Starting Informix Instance $ONCONFIG.  (No 'Y' in $INFTAB.)"
  fi
 else
  echo "Stopping Informix Instance $ONCONFIG"
  [ -f $BINDIR/rclogs.sh ] && rclogs.sh stop
  onmode -ky
 fi

done
Figure 13-2: The dbstart.informix.sh script

An inftab file provides a single point for all global Informix activities.  The difficult part is getting in the habit of using one.  However, if all startup, backup, and monitoring scripts base their actions on the inftab file, it will get used soon enough.  The DBAs will be happy because they can change a single file that they own, and Informix will automatically start up, back up, and monitor a new instance.  The SAs will be happy because they won't have to worry about changing a root-owned shell script every time a new instance is created.

Installing the dbstart.informix.sh script

If you'd like to begin using dbstart.informix.sh to start up your Informix instances automatically, follow the steps below to install and customize it for your environment.

Install the files 

Copy the dbstart.informix.sh, dbstart, and dbstop  programs into the same directory  (e.g., $INFORMIXDIR/local/bin) and make sure that they are executable.  If you have only dbstart.informix.sh, dbstart and dbstop are merely hard links to that file.  You can make those links yourself by entering:

$ ln dbstart.informix.sh dbstart
$ ln dbstart.informix.sh dbstop

Copy inftab into a directory that the informix user ID can write to (e.g., $INFORMIXDIR/etc).  (They can be placed in the same directory as the other files, but do not need to be.)

If you plan to use rclogs.sh with dbstart.informix.sh, you need to read about it later in this chapter, and to configure it as well.

Edit the inftab file 

If you have not already done so, edit the file $INFORMIXDIR/etc/inftab.    This works basically like Oracle's oratab file.  Each Informix instance should be listed in this file, in the following format:

onconfig_file:$INFORMIXDIR:Y|N:log_destination
onconfig_file

The first field should be the relative name of the onconfig file for that instance (e.g., prod, not $INFORMIXDIR/etc/prod).

$INFORMIXDIR
The second field should contain the value for the $INFORMIXDIR variable for that instance.
Y|N
If you are also using dbstart.informix.sh, placing a Y in the third field causes dbstart to automatically start this instance after a reboot.  (Please note that the "Y" is case sensitive.)
Some DBAs prefer to start their Informix instances manually.  If you wish to use dbstart.informix.sh but do not want the instances to start automatically, simply set this field to "N."
log_destination
If you are using rclogs.sh, the fourth field should contain the value that you want to use for the archive log destination.  This can be a directory or device name.  (If it is a directory, make sure that it is writable by informix.)

Edit the dbstart.informix.sh script 

The main thing that you need to do is to make sure that the location specified for the inftab file is correct.  This is done by changing the $INFTAB variable at the top of the script.  If you are not going to use rclogs.sh, you also want to delete the lines that refer to it.

Change the startup files 

Check your system documentation for the proper location of startup and shutdown scripts and place dbstart.informix.sh there.  On a SVr4-style Unix, you are looking for a file in one of the rc directories.  For example, on Solaris, there is probably a file in /etc/init.d, with links to it in other directories.  If the file is called informix, simply copy dbstart to informix.  This will cause the links to it to run it with the appropriate stop and start arguments.  On a BSD-style Unix, you are looking for a command somewhere in /etc/rc or /etc/rc.local.

Automating Archives with ontape: the infback.sh Utility

Infback.sh is a shell script that automates performing archives with ontape.  Before examining how infback.sh works, we explain why automating ontape backups is difficult.

Why automating ontape is difficult

The ontape utility is simple and flexible, but automating it has always been a little difficult, because it is a little picky about how it receives the answers to its questions.  For example, some versions of ontape do not accept a typical "here document ", as shown in Figure 13-17 below:

LEVEL=0
ontape -s <<EOF >/tmp/logfile
$LEVEL

EOF
Figure 13-17: Calling ontape with a here document

Ontape now accepts the use of a –L level argument, but it still requires you to respond to a prompt after executing the command. Ontape can still give you difficulties if you use the above syntax.

The method shown in Figure 13-17 is often mentioned in FAQs and other books, but it does not work on every version of Informix.  The method that does always seem to work is shown in Figure 13-18:

LEVEL=0
echo "$LEVEL

"| ontape -s | head -100 > /tmp/logfile
Figure 13-18: A more reliable way to call ontape

There are two differences between the methods shown in Figures 13-17 and 13-18.  The first difference is the way in which the answers are passed to ontape; Method 2 seems to be a little more robust.  The second difference between the two methods is the addition of the head command in the second one.  The head command is not required, but is a good precaution in case the backup device becomes full. Here’s why: once ontape detects that the backup device is full, it prompts for a second tape.  It is not very easy to answer provide a second tape and answer this prompt without using a program such as expect .  (There is a way to answer prompts like this by redirecting stdin and stdout to named pipes, but that can be really tricky with ontape.  Ontape prompts repeatedly for the second tape and things get pretty ugly very quickly.)  The head command keeps this repeated prompting from happening, since it truncates the output to 100 lines, but once the 100 lines have been reached, ontape aborts.

How infback.sh works

Infback.sh is a shell script that automates performing archives with ontape.  (As discussed above, its one limitation is that it cannot handle multi-volume archives.) 
Infback.sh consists of several files:
infback.sh
This is the main backup program that looks at the configuration files to decide how and what to back up.
rclogs.sh
This program is another main program that automates continuous backups of the logical logs using ontape -c.
infback.conf
This file is used by infback.sh to specify how, when, and what to back up.
inftab
This file lists all Informix instances on a machine.  It is used by dbstart.informix.sh, rclogs.sh and infback.sh to determine what instances are on the machine.
localpath.sh, rempath.sh, config.guess
These files accompany these other programs, and assist them in determining what commands to run on various Unix platforms.
Infback.sh is based on the same logic as Oracle’s oraback.sh and Sybase’s syback.sh.  Infback.sh:
  • Uses a global tabulation file (inftab) to list all Informix instances
  • Uses a global configuration file (infback.conf) to configure backups
  • Automatically performs full or incremental backups of all instances found in inftab
  • Optionally performs full or incremental backups of any instances listed on the command line
  • Can write archives  to disk or tape
  • Sends email, notifying of the success or failure of the backup
  • Backs up databases that reside on raw partitions or filesystems
Infback.sh can be called in one of three ways:

With no arguments

If you call infback.sh with no arguments, it decides what to backup and what device to use by looking at infback.conf.

With arguments specifying backup parameters

You can tell infback.sh which device and level to use by giving them as arguments.  If you do this without giving it a list of instances to back up, it will back up any instances it finds in inftab.  If you specify instances to back up, it will back up only the instances that you specify.

With at as the first argument, with or without backup parameter arguments

Specifying at as the first argument causes infback.sh to look at infback.conf to determine what time to back up.  It then schedules an at job using the same arguments given after the at argument.  (That means that the scheduled backup will either figure out what and how to backup via infback.conf or the arguments that were given.)

When infback.sh runs

One of the first things that infback.sh does is to check if the word skip is in field 2 of infback.conf.  If so, it skips the backup once, and removes the word skip from infback.conf.  (This allows a DBA to manually skip tonight's backup, but does not allow the DBA to accidentally disable backups forever.)

If infback.sh determines that it is not supposed to skip the backup, it then needs to determine what instances to back up ($INSTANCE_LIST), what level backup to run ($LEVEL) and what device to use ($DEVICE).  How infback.sh does this depends on which arguments (if any) it receives.
If infback.sh is called with no arguments

If called with no arguments:

$ infback.sh

infback.sh looks at the third field in infback.conf to determine what level of backup to run.  That field specifies the full backup day.  If today is the full backup day, then it performs a level 0 archive.  If it is not today, it performs a level 1 archive.  Infback.sh then looks at fields six and seven of infback.conf to get the name of the device server and device that it should backup to.  Finally, it looks at inftab for a list of instances to back up.

If infback.sh is called with arguments specifying backup parameters

If infback.sh is called with arguments as follows:

$ infback.sh level [device|host:device] [instancea instanceb ...]

it will determine its level and device from the arguments.  If it also receives a list of instances to backup, it will use that as the list of instances.  If not, it determines the list of instances to backup by listing each instance list in inftab.  The arguments and their possible values are as follows:

level
This should be a valid level for an Informix archive (0,1, or 2).
device | host:device
This should be a valid device name or directory name.  It can also be hostname:device (e.g., apollo:/dev/rmt/0cbn).
[instancea instanceb ...]
These arguments are optional.  You may specify one or more Informix instances to back up.  Specifying no instances causes infback.sh to backup all instances listed in inftab.

If infback.sh is called with “at” as the first argument

If infback.sh is called with at as the first argument (as it would be called in cron or at):

$ infback.sh at 

infback.sh sets the $TIME variable so that the backups take place at a specified time.  If it is a level 0  backup, infback.sh sets the $TIME variable to the value in field 4.  If it is a level 1 backup, it sets the $TIME variable to the value in field 5.  Infback.sh  then schedules an at job that will perform the backup at the time specified by $TIME. If there were other arguments given after the at argument, those arguments are passed to the scheduled run of infback.sh.  When the at job runs infback.sh, it will then determine what and how to backup based on the arguments (if any) that it was given.

The backup begins

Once the actual backup is supposed to run, infback.sh checks to see if the database is up.  If it is not, infback.sh complains and exits.  If it is up, infback.sh checks to see if there is enough space to make a change to the onconfig file .  What it does next depends on whether or not you specified that compression should be used.

If there is a value specified in infback.conf for $COMPRESS, infback.sh creates a named pipe called $INFORMIXDIR/$INSTANCE.level.$LEVEL.fifo, and changes TAPEDEV to that filename. It does this using onmonitor, so the change will be effective immediately.  After creating the named pipe and telling ontape to use it, it calls compress and tells it to read from the named pipe, compress the data, and write it to the location specified as the original device.  Infback.sh then calls either ontape or tbtape, depending on the version of Informix you are running , passing it the appropriate level.  It checks the status of the backup command and, if backing up to disk, compresses the backup file.

If there is no value specified for $COMPRESS, infback.sh sets TAPEDEV to $DEVICE_SERVER:$DEVICE_FILE using onmonitor.  It then calls ontape to perform the archive to the specified device.

Installing infback.sh and its configuration files

If you'd like to use infback.sh, you'll need to install the files in the appropriate directory, configure inftab and  infback.conf, and customize infback.sh to your environment.

Copy infback.sh, localpath.sh, rempath.sh, and config.guess into the same directory  (e.g., $INFORMIXDIR/local/bin) and make sure that they are executable.   
Copy inftab and infback.conf into a directory that Informix can write to (e.g., $INFORMIXDIR/etc).  Infback.sh needs to be able to write to this directory for the "skip" feature to work.  Inftab and infback.conf can be placed in the same directory as the other files, but they do not need to be.

Editing the infback.sh configuration files

If you have not already done so, you should configure inftab for use on this system.  For details on how to do that, read the previous "Editing inftab" section under the dbstart.informix.sh heading.

Editing infback.conf

Infback.conf is the configuration file for inback.sh and rclogs.sh.  It should contain one line for each machine in the following format:
hostname.master::full_day:full_time:inc_time:device_server:archive_dest:allow_ids:compress:mail_ids
hostname.master
Replace hostname with the base hostname.  For example, if the hostname is apollo.domain.com, this field should contain apollo.master.
full_day
This is the day of the week that full backups should run.  (All other days of the week will receive level 1 backups.)
full_time
If using the at argument, this is the time that the program should schedule level 0 backups.  Suppose that it says 1900, and the full backup day is Mon.  At 1500 on Monday, there is a cron job that runs infback.sh at.  That will see that Monday is a full backup day, and schedule an at job to run at 1900.
inc_time
If using the at argument, this is the time that the program should schedule level 1 backups.
device_server
Set this to the hostname of the server that contains the backup device.  If it is the same as this host, enter the base hostname only (just like in the first field).  For all other hosts, use the FQDN if it is appropriate.
archive_dest
This should be set to a device or directory that will contain all archives.  If it is a directory, make sure that it is writable by informix.  Also, if it is a directory, infback.sh will create a subdirectory for each instance inside this directory.
allow_ids
This is a '|' separated list of user ids that are allowed to run infback.sh.  This is usually only informix.
mail_ids
This is a comma-separated list of user IDs that should receive mail about the success of infback.sh

Editing infback.sh

There are a few minor changes that you need to make to the infback.sh file itself.  Locate the following variable and function declarations in the top of the script, and set them to the appropriate value for your environment.
DEBUG=
Set this to "Y" if you want to see debug information for all functions (i.e. turns on set -x).
BINDIR=
Set this to the directory where you copied the backup programs (e.g., $INFORMIXDIR/local/bin)
LOGDIR=
Set this to the directory where you want infback.sh to log its information (e.g., $INFORMIXDIR /log).
LOG=
Set this to the full path of the name of the logfile you want it to use (e.g., $LOGDIR/infback.log).
INFCONF=
Set this to the full path of infback.conf  (e.g., $INFORMIXDIR/etc/infback.conf).
INFORMIX=
Set this to the user that owns the informix instance (usually informix).
INFTAB=
Set this to the full path of inftab (e.g., $INFORMIXDIR/etc/inftab)
TMP=
Set this to the directory you want infback.sh to use for temporary files.
Preback
Anything that is put inside this function will be executed prior to running the backup.
Postback
Anything that is put inside this function will be executed when the backups are finished.

Centralized configuration

Just like oraback.sh, the configuration file infback.conf can be shared via NFS.  If multiple servers share the same configuration file, and you are using the at argument, you could make changes to all Informix backups by changing one file.  Suppose that Informix backups are currently set up to run a full backup on Sunday at 1900.  However, you know that the network will be down this Sunday.  With most home-grown backup scripts, you would need to log into several servers and change multiple cron entries.  With a centralized infback.conf file, you need only to changefield three for each server from "Sun" to "Mon."  If you know that there will be some intensive processing this evening, you could also skip all infback.sh backups by putting the word "skip" in field two.

Scheduling backups

To use all scheduling features of infback.sh, create a cron entry that calls infback.sh at a time earlier than the earliest time specified in fields four and five in infback.conf.  Since most backups are run after 6 P.M., a common entry would be like the following:

0 17 * * * /informix/local/bin/infback.sh at

This specifies to run the script with the at argument at 5 P.M.  This causes infback.sh to look at the infback.conf file to determine what level of backup to run, and what time to run it.  It will then schedule an at job for the appropriate time.

The reason for keeping the entry as late as possible is to allow the DBAs to make changes to infback.conf.  Since infback.sh does not look at the file until 5 P.M., they can change tonight's backup time or skip tonight's backups by changing the file any time before then.

Automating Continuous Backups: the rclogs.sh Utility

The rclogs.sh program can back up to either tape or disk, but it works best if backing up to disk because it can automate the "swap tapes" step by automatically moving and creating files as needed.  The first step that rclogs.sh performs is to check that the Informix instance is online.  It performs a WHILE loop until the instance reports "On-line" or "Read-only."  If it stays in this loop for 60 seconds, it exits with an error.  Without this feature, a malfunctioning instance would prevent other instances from starting when this program is called from dbstart.

The next thing that rclogs.sh does is check to see if there are any ontape -c backups running for this instance.  If so, it stops them.  If rclogs.sh was called with the stop argument, it then exits.  If it was called with the start argument, it then needs to "swap tapes."  If backing up to disk, rclogs.sh moves the continuous backup file to a date/time-stamped file and creates an empty file for the next ontape -c session.  If backing up to tape, this program cannot be run from cron; it must be run manually from a terminalbecause once it stops the ontape -c session, it can only notify the operator running the program to swap the tape, and wait for notification that this has been done. Once rclogs.sh knows that the tape has been swapped, it will start a new ontape -c session in the background.  It then queries Informix to verify that continuous backups are running, and sends notification of success or failure.

Installing rclogs.sh and its configuration files

Install the files rclogs.sh, localpath.sh, rempath.sh and config.guess in the same directory (e.g., $INFORMIXDIR/local/bin) and make sure that they are all executable.  Install inftab and infback.conf in a directory writable by informix (e.g., $INFORMXDIR/etc).  (These two files do not have to be in the same directory as the executables, but they can be.)  

Editing rclogs.sh and its configuration files

Make sure you have already configured the inftab and infback.conf files for use on this system; details on how to do this can be found in the previous Editing the infback.sh configuration files section. (The only field that rclogs.sh uses from infback.conf file is the mail ids field.)

Check the site-specific section at the top of rclogs.sh and make sure that all the values are appropriate for your environment.  The following values are found there:

DEBUG=
Set this to "Y" if you wish to see debug information (set -x).
INFTAB=
Set this to the full path of your inftab file.
COMPRESS=
Set this to the compression command that you wish to use (e.g., gzip).
COMPSUFF=
If you change the compression command from the default value of "compress," then you need to change this value.  It is the suffix that your compression command uses (e.g., use gz for gzip).
BINDIR=
Set this to the location of infback.sh and the other programs (e.g., $INFORMIXDIR/local/bin).
THRESHHOLD=
This should be set to a percentage between 50 and 100 if you are backing up to disk.  Once the filesystem specified by $ARCHIVEDEST is this full, it does some extra cleanup and notify you.
TMP=
Set this to the directory that you wish to use for temporary files.
INFORMIXDIR=
This can normally be left alone, since it is determined from inftab.
ONCONFIGFILE=
This can also normally be left alone, but if you have a unique location for your onconfig files, specify it here.
ARCHIVE_DEST=
This is also determined by looking at inftab.
INFORMIXSERVER=
This is automatically determined by looking at the onconfig file.
LOGDIR=
Set this to a directory that you want to use for logs (e.g., $INFORMIXDIR/logs).
LOG_FILE=
Set this to the name of the log file that you wish to use.
PATH=
You normally should not need to change this.
DBAS=
If you've already specified the use of infback.conf, the value of this field is determined from there.  If not, you can specify a list of mail IDs to mail to.  (Enclose them within quotes if there is more than one.)

Testing the rclogs.sh program

Before adding the rclogs.sh script to cron, you might want to run it a few times to make sure that it works in your environment.  Run rclogs.sh:
  • With the stop argument to make sure that it stops the appropriate logs. 
  • With the start argument to make sure it creates the file and starts the ontape -c process. 
  • Multiple times with the start argument, and make sure that it stops and starts the appropriate logs.

Scheduling backups

Once you are sure the program works for you, you have a few options for how it is used.  If you have installed dbstart.informix.sh, it automatically calls rclogs.sh when the system shuts down or starts up.  This means that continuous backups are automatically started when the instance is started using dbstart.informix.sh.
If you are backing up to disk, you can greatly increase your recoverability options by running rclogs.sh every hour or half-hour.  This is especially true if you have added some commands to the Backup_the_backup function.  Instead of having one large log for each day, you will have many small logs that get backed up throughout the day.  Doing this ensures you'll never lose more than 30 minutes worth of data.  The following cron entry runs rclogs.sh every half-hour:

00,30 * * * * /informix/local/bin/rclogs.sh start

Using the Scripts Together

The scripts discussed in the previous sections all work together.  Dbstart, rclogs.sh, and infback.sh all use the inftab file.  Rclogs.sh and infback.sh both use the infback.conf file.  Dbstart automatically calls rclogs.sh.  Running rclogs.sh on an hourly or half-hourly basis will provide you with multiple logical log backups that you can use at recovery time.  Running a weekly full and daily incremental backup using infback.sh will reduce the amount of time spent doing backups, and still requires only three tapes for a restore (the third tape is the logical log backup).