#!/usr/bin/sh # script to generate overview files from the log files that summarize the # monthly readings, taken at midnight of the 1st of each month. The # summary files contains a line for each full reading month and unit #root=/home/chris/construction/BTUmetering # the root directory gets set by the configure script root=MAINPROGROOT logdir=$root/log sumdir=$root/log progdir=$root/scripts summaryfile=$sumdir/e_summaryfile # serial number list of Landis&GYR measurement units. adrlist=("94529486" "94529485" "94529479" "94529480" "94529484" "94529481" "94529482" "94529487" "94529483" "94529488" "99828529" "99828528" "38751745" "40183481" "38751742") # human-readable form loglist=("EAHU2" "EAHU1" "MDB1" "MDB6E" "MDB7E" "MDB2" "MDB3" "EAHU3" "MDB4" "EAHU4" "MDB6" "EAHU6" "MDB3-S14" "E-MDB3-S14" "EAHU3-S14") # generate a summary file out of all previous data rm -f $summaryfile for ((i=0 ; $i< ${#loglist[*]} ; i++)) do uname=${loglist[$i]} uadr=${adrlist[$i]} f1="$logdir/emeter_$uadr.log" $progdir/convert_elog_to_monthly.awk -v unitname=$uname $f1 >>$summaryfile done