2016-09-01 - Re: [GRASE-Hotspot] script to auto-delete expired users

Header Data

From: Timothy White <ti***8@gmail.com>
Message Hash: b68782ee3f39a5dad5b54ffa3817ba8a7ab36ae73494db91cc2af4b2518a774f
Message ID: <CAESLx0+2_UbtJ+w2G2b8VVdK2sf5TwgyDWk8GeWdkA4iCT79gA@mail.gmail.com>
Reply To: <CAH-3qCL4qar0sw4oi0PuHY05G3A0O6j5aQFY+G9tsPGr4F0hBQ@mail.gmail.com>
UTC Datetime: 2016-09-01 17:37:30 UTC
Raw Date: Fri, 02 Sep 2016 10:37:30 +1000

Raw message

Hi Gianluca

I'm wondering why you are wanting to do this, considering it's done for you
automatically already. Expired users are currently deleted 2 months after
they expire. At the end of each month, the previous months traffic logs are
"bundled up" into a single monthly total, and added to the motacct table.
This is a very compact format so I wouldn't concern myself with deleting
data out of that table.

It is possible to modify the current cleanup process to delete when they
have been expired for only 1 month.
You'll want to look at
https://github.com/GraseHotspot/grase-www-portal/blob/master/files/usr/share/grase/www/radmin/classes/CronFunctions.class.php#L168
to see where we do the deletions. If it's not working for you, check that
the cronjob is running daily.

Regards

Tim

On Tue, Aug 30, 2016 at 7:28 AM, Gianluca Filippini <
gi***4@gmail.com> wrote:

> hi,
>
> I was wandering if someone can guide me on which tables I need to cleanup
> for the following purpose:
>
> I want to delete automatically (with a bash/cron script running every
> midnight) the old users that are expired from a (for example) 1 month or
> more.
>
> I see where the users are located ... but how do I cleanup the traffic
> logs? I know it is a matter of looking into the DB tables .. just wondering
> if someone can guide me so I do not forget details...
>
> thanks in advance.
>
> --
> This mailing list is for the Grase Hotspot Project http://grasehotspot.org
> ---
> You received this message because you are subscribed to the Google Groups
> "Grase Hotspot" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to gr***e@grasehotspot.org.
> To post to this group, send email to gr***t@grasehotspot.org.
> Visit this group at https://groups.google.com/a/
> grasehotspot.org/group/grase-hotspot/.
> To view this discussion on the web visit https://groups.google.com/a/
> grasehotspot.org/d/msgid/grase-hotspot/CAH-3qCL4qar0sw4oi0PuHY05G3A0O6j5a
> QFY%2BG9tsPGr4F0hBQ%40mail.gmail.com
> <https://groups.google.com/a/grasehotspot.org/d/msgid/grase-hotspot/CAH-3qCL4qar0sw4oi0PuHY05G3A0O6j5aQFY%2BG9tsPGr4F0hBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

Thread