#!/bin/sh # # This is a shell archive. To extract its contents, # execute this file with /bin/sh to create the file(s): # # keystroke logcheck.sh readme.txt # # This shell archive created: Fri Feb 15 09:24:35 EST 2002 # echo "Extracting file keystroke" sed -e 's/^X//' <<\SHAR_EOF > keystroke X#!/bin/sh X## Script: keystroke X## Date: February 13, 2002 X## Modified: X## X## Author: AO-OIT-SDSD X## Maintained by: Tom Garner X## Version: 1.0 X## Purpose: This file is a keystroke file for the input X## on logcheck.sh. X## X X X Xn X SHAR_EOF if [ `wc -c < keystroke` -ne 226 ] then echo "Lengths do not match -- Bad Copy of keystroke" fi echo "Extracting file logcheck.sh" sed -e 's/^X//' <<\SHAR_EOF > logcheck.sh X#!/bin/sh X## Script: logcheck.sh X## Date: February 13, 2002 X## Modified: X## X## Author: AO-OIT-SDSD X## Maintained by: Tom Garner X## Version: 1.0 X## Purpose: To establish what logs are contained on a logical X## log tape. This has been written to read tape's only and X## not a file. This will come later. X Xtput clear Xecho "Enter tape id (0,1,2) \c" Xread resp Xecho "This process will take 5 to 10 minutes" Xecho "Please be patient...thanks" Xmt -f /dev/rmt/${resp}n rewind Xsleep 300 Xecho "" Xonlog -d /dev/rmt/${resp}n < /app01/informix/current/keystroke 1> /tmp/dumplog Xgrep BEGIN /tmp/dumplog | nawk ' { print $5 } ' | sort -u Xecho "" Xecho "Done...these are the logs on this tape." Xecho "Please label the tape." SHAR_EOF if [ `wc -c < logcheck.sh` -ne 707 ] then echo "Lengths do not match -- Bad Copy of logcheck.sh" fi echo "Extracting file readme.txt" sed -e 's/^X//' <<\SHAR_EOF > readme.txt X## Author: Tom Garner, James Thompson X## Company: US Courts X## Create Date: February 15, 2002 X## Modification Date: X## Database: Informix IDS 7.31.UC4 X## OS: Solaris 7, Intel X XProblem: XWe had some logical log tapes that were not labeled properly X(the log numbers were not recorded). We needed a way to retrieve Xwhat logs numbers were contained on a specific tape(s). X XAfter speaking with Informix support there was no specific utility Xto get at the "specific" information we wanted, which was the log Xnumbers only. X XSolution: XWe developed a couple of scripts to get at the information we needed. XThe Informix utility that is used is the onlog utility but the script Xlogcheck.sh strips the output to retrieve the logs numbers contained Xon the tape. X XNote: XThese programs were developed for a tape device. Since our platform Xis a Solaris 7 (Intel) the scripts are simple shell programs. X XIf you are using files for your logical logging then mods will have to Xbe made. X X**There is no implied warranty, and we are not responsible for Xany problems these scripts may cause. (Though I cannot think of any Xproblems....it might cause)** X XThe package contains two files: X Xkeystroke - Answers to the onlog command X Xlogcheck.sh - is the shell script which prompts X for the tape device, then runs onlog X and strips out the information on the X log numbers. X XFiles must be owned by informix:informix; XPermissions set to: 755 SHAR_EOF if [ `wc -c < readme.txt` -ne 1432 ] then echo "Lengths do not match -- Bad Copy of readme.txt" fi echo "Done." exit 0