#!/usr/bin/sh
. /opt/platform7/lbin/profile

Date=$(date +%Y%m%d)
File3=ifpcusage_weekly
File4=ifpcusage_weekly_$Date
DateFile=MergeDate
Dir=/home/bmetzger/s/p7syshealth
RawIfpc=$Dir/raw_data/ifpcusage
RawWeek=$Dir/raw_data/weekly
Weekly=$Dir/weekly_data
Report=$Dir/report_data

cd $Dir
/usr/contrib/bin/gunzip $Weekly/ifpcusage_*
$Dir/MergeSysHealthFiles `ls $Weekly/ifpcusage_*` > $Report/$File3
/usr/contrib/bin/gzip $Weekly/ifpcusage_*
mv $Weekly/ifpcusage_* $RawIfpc

cd $Report
cat $Report/$File3 | awk -f $Dir/SysHealthExceptions.awk $Date
mv $Report/$File3 $RawWeek/$File4
/usr/contrib/bin/gzip $RawWeek/$File4
echo $Date > $Dir/$DateFile

#mailx -s "Weekly IfpcExceptions Report" reports <<Eof
#Scott,
#
#The Weekly IfpcExceptions report has been generated via cron.
#
#Please ftp the following files over to your PC:
  #NoIfpcs_$Date.txt
  #HighCpu_$Date.txt
  #LowMem_$Date.txt
  LowCap_$Date.txt
  #NonIfpc0Sync_$Date.txt
  #NoSync_$Date.txt
  #Comments_$Date.txt
#
#These files are located in $Report on a7csvr1.
#
#Please run the excel macro to generate the weekly report.
#
#Ross
#
#Eof

