On Mon, Apr 04, 2005 at 09:32:31PM +0200, Kilian Krause wrote:
> Hi Jose,
> 
> > > Or simply: purge all records older than a month.
> > 
> >  Yes, that should work, IMO. I though about using sql after writing my
> > previous mail to this bug. The problem with this is that I am quite bad
> > with sql (I actually don't know the language) so if someone could write
> > the "query" to use...
> 
> the query would be something like "delete from $mytable where
> $insertdate < $(today-1month)" with the variables holding the correct
> names etc.

So what's up with this?

I believe the command should be:

  echo "delete from cdr where julianday('now')-julianday(start) > 30;" \
        |sqlite /var/log/asterisk/cdr.db

One my system this seems to be off by an hour or two due to timezone 
issues. Not a big deal, I figure.

As someone has noted, this probably won't shrink the database. How do I
do that?


> 
> Yet I strongly disagree with this behaviour for a default. At least the
> 1 month rollback sounds like too few from a data-warehouse point of view
> and too much from a duty of secrecy point of view. The only real
> alternative sounds to be a debconf asking for the proper length.
> 
> Does that sound ok for everybody?

If this is what you think, you should start by changing the default log
rotation of cdr-csv/Master.csv . Records there are deleted after about a
month.

-- 
Tzafrir Cohen     icq#16849755  +972-50-7952406
[EMAIL PROTECTED]  http://www.xorcom.com


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to