: /bin/sh # create history logs # and trim the clp packer log file # should be run at midnite from cron (before trimfile on logfile) #/* #************************************************************************* #** * #** Copyright (C) 1997 Trans-Mit Pty. Ltd. Melbourne Australia * #** This software may not be loaned, resold, changed or copied * #** in any way without the express written permission of author * #** and Trans-Mit Pty. Ltd., Australia. * #** * #************************************************************************* #** #** $Header $ #** $Author: catcom $ #** $Date: 2004/06/16 03:56:42 $ #** $Locker: $ #** #************************************************************************* #*/ PATH=$PATH:/u/catcom/bin PACKERLOGFILE=/u/catcom/clp/log # move do directory where log files are cd /u/catcom/clp # Trim out daily stats grep "23:59:.." $PACKERLOGFILE >>$PACKERLOGFILE.daily # Trim out hourly stats grep "..:00:.." $PACKERLOGFILE >>$PACKERLOGFILE.hourly # Get errors egrep -v "^$|Rec: ...........Rej: |dopak:|rawsmdr|killpak|PC-CLU PABX|do_terminate|my_exit: errcode = 0" $PACKERLOGFILE >>$PACKERLOGFILE.err # Trim the log file. /u/catcom/bin/trimfile -f$PACKERLOGFILE -n 0 # Trim error log file. /u/catcom/bin/trimfile -f$PACKERLOGFILE.err -n 1000 # Trim the daily history log file. (keey a maximum of 12 months) /u/catcom/bin/trimfile -f$PACKERLOGFILE.daily -n 365 # Trim the hourly history log file. (keep a maximum of 12 months) /u/catcom/bin/trimfile -f$PACKERLOGFILE.hourly -n 8760 # archive raw smdr file pcclunodename=`uname -n` rawarcfile=`date -d "1 day ago" "+%Y%m%d_${pcclunodename}.raw"` if [ -f /u/catcom/clp/rawsmdr ]; then mv /u/catcom/clp/rawsmdr /u/catcom/clp/raw/$rawarcfile fi # kill packer & start afresh each midnight killpak >>$PACKERLOGFILE 2>&1 exit #/* #** $Log: dohistorylog,v $ #** Revision 1.3 2004/06/16 03:56:42 catcom #** NCR818 - pcclu for slackware 9.1 (kernel 2.4.22) #** - incl. raw data logging and archiving (re: BOM) #** # Revision 1.2 97/12/23 11:38:12 catcom # added error log file # # Revision 1.1 97/12/17 14:42:42 catcom # Initial revision # #** $Revision: 1.3 $ #** $Source: /u/catcom/AccTraf/src/pcclu/RCS/dohistorylog,v $ #** $State: Exp $ #*/