On Monday 17 February 2003 08:46, Duane Barnes wrote:
> Does anyone have any radacct myql purge scripts.  For example, say I only
> wanted to keep 45 days of accounting data in my mysql db.

Here is the one that I use in my cron.monthly. It is run once a month and 
deletes everything that is older than 1 month. Modify to suit your needs.


#! /bin/bash

echo "delete from radacct where AcctStartTime < date_sub(now(),INTERVAL 1 
MONTH);" | mysql -uUSERNAME -pPASSWORD DATABASE_NAME

The above should all be in one line, I'm sure the email system will word wrap 
it!

Nick
-- 
Nick Davis 
Associate Systems Administrator 
[EMAIL PROTECTED] 
Internet Exposure, Inc. 
http://www.iexposure.com  

(612)676-1946 
Web Development-Web Marketing-ISP Services

- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to