I have thrown together the following script for shuffling the detail
files once a month - run it as often as required - it only keeps 6 files.
The script uses a file '/etc/raddb/radius.routers'
which just lists the hostnames of the routers for which detail files
are shuffled.
---#!/bin/sh # # roll-detail - script to shuffle detail files # # Darren Besler (dbesler@beehive.mb.ca) - Aug 30, 1996 # Beehive Enterprises #
root=/usr/adm/radacct/
for router in `cat /etc/raddb/radius.routers` ; do cd $root$router if [ ! -f detail ]; then echo "$router: detail file not shuffled - does not exist" continue fi
if [ -f detail.5 ]; then if [ -f detail.6 ]; then echo "$router: detail.6 removed" rm detail.6 fi mv detail.5 detail.6 fi if [ -f detail.4 -a ! -f detail.5 ]; then mv detail.4 detail.5 fi if [ -f detail.3 -a ! -f detail.4 ]; then mv detail.3 detail.4 fi if [ -f detail.2 -a ! -f detail.3 ]; then mv detail.2 detail.3 fi if [ -f detail.1 -a ! -f detail.2 ]; then mv detail.1 detail.2 fi if [ -f detail.0 -a ! -f detail.1 ]; then mv detail.0 detail.1 fi
if [ ! -f detail.0 ]; then mv detail detail.0 echo "$router: detail file shuffled at `date`" else echo "$router: detail not shuffled - detail.0 exists" fi done
-- Darren R Besler PO Box 2207 Stn Main Beehive Enterprises Winnipeg, Manitoba, Canada, R3C 3R5 Ph: 204-896-6103 Fax: 204-896-4168 Email: dbesler@beehive.mb.ca