Menu

LogCleanup

Anonymous

Clean up old logs taking up space

Freeradius seem to leave detailed logs that can grow quite big and a few months down the line you will scratch your head trying to figure out whats eating all your hard drive space. You could probably disable these logs in the freeradius config, I haven't checked. I actually like having them for incase. I just don't need the logs from six months ago.

Again, this example is Ubuntu specific. It may also be the same on any other Linux. If you followed the instruction to install freeradius from this wiki, then the detailed logs should sit at:

/usr/local/var/log/radius/radacct/NAS_IP_ADDRESS/detail*

To make sure I don't keep a massive pile of logs, I whipped up a script that will delete logs older than 14 days:

$ vi ~/scripts/cleanup.sh

#!/bin/sh
/usr/bin/find /usr/local/var/log/radius/radacct/NAS_IP_ADDRESS/detail* -mtime +14 -exec rm {} \;

Replace NAS_IP_ADDRESS with the address of your NAS. Now lets put it in cron:

$ crontab -e

15 01 * * * /home/YOURUSER/scripts/cleanup.sh >/dev/null 2>&1

There you go ;)


Related

Wiki: Home