truncate_radacct script deleted more then desired

YvesDM ydmlog at gmail.com
Wed Jan 2 14:37:50 CET 2008


Hi Liran,

Yes I thought it's shipped with dialup admin so...
But ok, I'll attach the script with this reply.
I noticed in scripts.log that it also deleted to much last year.
I think the problem is where $date gets created. I see wrong dates in the
log file (scripts.log), for example:

2008-01-02 00:01:01
DELETE FROM radacct WHERE AcctStopTime = '0000-00-00 00:00:00' AND
AcctStartTime < '2008-01-02 00:01:01';
2008-01-02 00:01:01
LOCK TABLES radacct WRITE;DELETE FROM radacct WHERE AcctStopTime <
'2008-01-02
00:01:01' AND AcctStopTime IS NOT NULL ;UNLOCK TABLES;

First one is from clean_radacct to clean stale sessions, $back_days is set
to 35 days, so the timestamp in the logfile should not be todays date but 35
days ago (correct me if i'm wrong) Now it just deleted all open sessions.
:-(

Second log entry is from truncate_radacct, same problem with timestamp,
$back_days is set to 365, so the timestamp should be one year older.

Kind regards,
Y.



Many tnx.



On Jan 2, 2008 8:23 AM, liran tal <liransgarage at gmail.com> wrote:

> Hey Yves,
>
> It would probably be better if you attach the script for those
> of us who don't have it around...
>
> Also, if you run it with certain arguments maybe you should let
> us know how you ran it.
>
> Regards,
> Liran.
>
> On Jan 1, 2008 4:06 PM, YvesDM <ydmlog at gmail.com> wrote:
>
> > Hi,
> >
> > FR1.1.6 on debian.
> > I use the truncate_radacct script  that comes with dialup admin to
> > delete older accounting records.
> > I got the $back_days set at 365 days in order to keep the accounting
> > data for one year.
> > It 's been working fine untill this morning (1/1/08, 00:01) Instead of
> > deleting data older then 01/01/07 it deleted all data older then 01/01/08,
> > or everything in radacct :-(
> > I 've got backups, that's not the problem, but I wonder what went wrong
> > here. Anyone experiencing the same, any clues?
> >
> > Kind regards
> > Yves
> >
> > -
> > List info/subscribe/unsubscribe? See
> > http://www.freeradius.org/list/users.html
> >
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20080102/0cbc36a5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: truncate_radacct
Type: application/octet-stream
Size: 1875 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20080102/0cbc36a5/attachment.obj>


More information about the Freeradius-Users mailing list