Run an Archive in the Background and Monitor it

The OnLine archiving programs assume that there will be a user sitting at a terminal monitoring the archiving process. Many times this is not a realistic option due to staffing problems. If you have large-capacity tapes, you can place the archiving and automatic backup of logfiles in the background and monitor them through log files. These techniques will work only if you are absolutely sure that you will not need to change tapes in the middle of an archive. Another reason to buy big DAT tape drives!

Refer to the chapter on "Understanding the Concepts" for a more detailed discussion on archives and the limitations of the OnLine archiving system. In that chapter we presented the following script, called do_level_1_archive:

INFORMIX 73> cat do_level_l_archive
#!/bin/csh
date
$INFORMIXDIR/bin/tbtape -s << EOF
{note, this line is a control-m, or carriage return. don't type note}
1
EOF

Running the do_level_l_archive script will send the output of the tbtape command to the standard output, your current screen. For running in the background, this is not what we want. I use a script to drive the do_level_l_archive script and redirect the output. This script is called run_level_l_archives.

INFORMIX 74: cat run_level_1_archives
#!/bin/csh
$INFORMIXDIR/local_bin/do_level_1_archive >& $INFORMIXDIR/archive.log &

This script provides us with several useful features. First, it lets the archive run in the background, and second, it gives us a logfile to check to see how far along the archive has progressed. The tbtape program uses the UNIX curses screen I/O functions and is designed to provide screen output, not file output. As such, the output looks like one long character string to UNIX. The tbtape command does provide a running count of the percentage complete on the archive. To return a percentage complete string out of the archive.log file, use the peek_arc script.

tail –30c $INFORMIXDIR/archive.log

You'll see peek_arc used in the status script later that pulls many of these one-liner and other scripts together into a dashboard to look at the performance of the OnLine engine.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.248.119