Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > by-pkgid > 4aadd45f221424a24a93e5fc1e8faba3 > files > 53

diald-1.0-12mdv2010.0.x86_64.rpm

#!/bin/bash

#Ok, here's the simplest script.  I run this one daily from cron at
#midnight, and all it does is run logreporter over the accounting log
#from the last 24 hours, then append the data to the weekly logfile and
#truncate the accounting logfile.  Make sure that cron is mailing its
#output to you, and you'll get the daily summary in your mailbox.

LOGDIR=/var/adm
LOG=diald.log
LOGREPORTER=/usr/local/bin/logreporter
TEMPLATE=diald.template

cd $LOGDIR
$LOGREPORTER $TEMPLATE $LOG
cat $LOG >> $LOG.0
cp /dev/null $LOG

# EOF