return to PRS Technologies website


archecker.sh
#!/usr/bin/ksh ############################################################################### # # Module: archchecker.sh # Author: Peter R. Schmidt # Description: Test the Informix database backup # # Change Log # # Date Name Description................. # 05/30/01 Peter R. Schmidt Start Program # ################################################################################# # Purpose # ------ # The archecker is designed to validate a level 0 archive without # impacting the production system, ensuring that all data required to # restore a system exists on the archive tapes in the correct format. # # Features # -------- # - Checks a level 0 archive after the archive has completed # - Verification need not be done on the machine hosting the OnLine system. # - Minimal system resources are required, even for large archives. # - Restartable at tape level. # - Detects missing pages and indicates affected table(s). # - Can also verify data in similar fashion to oncheck -cd. # - Progress monitor # - Creation of the INFO directory give many usefull reports about the archive. # # Setup and Operation # ------------------- # Set the environment variable AC_CONFIG to the name of your # configuration file. Otherwise $INFORMIXDIR/etc/ac_config.std is # used by default. If no valid config file is found, archecker will # print an error message and exit. # # A sample configuration file: # ---------------------------- # # AC_STORAGE /tmp # AC_MSGPATH /home/informix/logs/archecker.log # AC_TAPEDEV /dev/rmt/0 # AC_TAPEBLOCK 16 # AC_VERBOSE 1 # # Valid Configuration file parameters # ----------------------------------- # # AC_STORAGE # The name of a directory where temporary files # are kept. The amount of space required is determined # by two factors: the number of chunks and the number of tables. # To give you a guide, a 50GB OnLine system should take about 20MB # (your mileage may vary). # DEFAULT: your current directory. # # AC_MSGPATH # Pathname of archecker's message log. All error # and status messages will be placed in this file. # DEFAULT: ./msg.log # # AC_TAPEDEV # Name of the tape device. # DEFAULT: NONE # # AC_TAPEBLOCK # The size of the tape block in KB. It must match the # blocksize used for the archive, otherwise an error # will indicate the correct blocksize to use. # DEFAULT: NONE # # AC_VERBOSE # 0 Do not be verbose # 1 Verbose output # DEFAULT 0 # # Command Line Usage # ----------------- # archecker may be invoked by itself or with the following options: # # -v Enables the verbose output # -d Cleanup any temporary files from a previous run. # -s Display the verbose message to the screen. # -t Use ontape tape device # -H to get a basic usage method # -R To restart at the last sync point (i.e. tape) # -V to get the current tool version # -b Direct XBSA access # -D Delete old files and EXIT # -F Retrieve list of pages off the archive # -P Read Performance - info only # -T Restart at a specific tape # # Recommended Usage: # # archecker -tdsv # # Verbose Option # -------------- # With the verbose option on, dots are to the screen--one # for every 25MB of data read from the tape. Each line of # dots represents 1GB of data. # ################################################################################ # Note: if LOGFILE1 matches the AC_MSGPATH parameter in the ac_config.std file, # then this will effectively rotate the log file. LOGFILE1=$INFORMIXHOMEDIR/logs/archecker.log LOGFILE2=$INFORMIXHOMEDIR/logs/archecker.log.OLD if [ -f $LOGFILE1 ]; then if [ -f $LOGFILE2 ]; then rm -f $LOGFILE2 fi mv $LOGFILE1 $LOGFILE2 rm -f $LOGFILE1 fi ############################################################################### time archecker -tdsv # Note: if you want to run archecker in background and your backup is only # one volume of tape, you can do it this way... # # # time archecker -tdsv <<-EOF # 1 # 0 # EOF ################################################################################ # Send log file via e-mail grep -v "partition file" $LOGFILE1 | mailx -s "Archecker" username@mydomain.com ###############################################################################