Here's a short script that I call "monthend". I run it with a cron job at
one minute before midnight on the last day of the month. The current month's
detail is moved to detailmm.yy (e.g. detail11.96). I then use the old
detail file to process the user's total usage for the month. raquick
can be found on one of the many web sites that have PortMaster scripts.
#!/bin/csh
#
# Move the detail files to their proper month.year
set DAT = `date +%m.%y`
cd /var/adm/radacct/pm1
mv detail detail$DAT
cd /var/adm/radacct/pm2
mv detail detail$DAT
#
# generate real month-end report
/etc/raddb/raquick /usr/adm/radacct/pm1/detail$DAT> /tmp/ra1
/etc/raddb/raquick /usr/adm/radacct/pm2/detail$DAT >> /tmp/ra1
date > /home/tm/acct$DAT
sort /tmp/ra1 >> /home/tm/acct$DAT ; chown tom /home/tm/acct$DAT
========================================================================
Joe Hartley - jh@brainiac.com - brainiac services, inc
PO Box 5069 : Greene, RI : 02827 - vox 401.539.9050 : fax 401.539.2070
Without deviation from the norm, "progress" is not possible. - FZappa