#!/bin/sh
#
# Collect daily statistics, reliability reports, etc.
# USER should be 'monitor'
BIN="/p/stat/bin"
STAT="/p/stat/STAT"
PATH=$BIN:$PATH:/usr/local/bin
export PATH
cd $STAT
daily_stat.pl
stat_load.sh
summ_to_month.pl -D $STAT -T 45
if [ -d opreports/ITER ]
then
 cp /dev/null opreports/ITER/.www_browsable
 find DBDATA/OLD -type f -mtime +30 -exec rm -f '{}' \;
 find opreports -type f -mtime +90  -exec rm -f '{}' \;
fi
# save 3 notify files
if [ -f notify.2 ]
then
    mv notify.2 notify.3
fi
if [ -f notify.1 ]
then
    mv notify.1 notify.2
fi
cp notify  notify.1
cp /dev/null notify
