Clear records from xml_cdr

General discussion related to Freeswitch AMI products. Readable to public, writeable to registered users.
ozeebrown
Posts: 4
Joined: Sat Nov 05, 2016 8:17 am

Clear records from xml_cdr

Postby ozeebrown » Sat Nov 05, 2016 8:31 am

Hi. I have been using FusionPBX at ASW Market Place for few months now. My disk is just 8GB on a t2.micro The space is critical due to CDR information recorded on the database.

Question : How do I remove cdr recorded on the database?

Something like following would work for MYSQL

#!/bin/sh
/usr/bin/mysql -u root fusionpbx -e "DELETE FROM v_xml_cdr WHERE DATE(start_stamp) <= DATE(SUBDATE(NOW(),365))";

But we have SQLite database.

Thank you. Guy.

jsun
Site Admin
Posts: 83
Joined: Tue May 26, 2015 9:52 pm

Re: Clear records from xml_cdr

Postby jsun » Tue Nov 08, 2016 6:44 pm

You would do the following for sqlite database. Let me know if that works.

Code: Select all

sudo su
sqlite3 /var/www/html/fusionpbx/secure/fusionpbx.db "DELETE FROM v_xml_cdr WHERE DATE(start_stamp) <= DATE(SUBDATE(NOW(),365))"

ozeebrown
Posts: 4
Joined: Sat Nov 05, 2016 8:17 am

Re: Clear records from xml_cdr

Postby ozeebrown » Wed May 03, 2017 8:08 am

Hi,

Thank you for your previous reply.

My SQLITE fusionpbx.db is over 1TB.
I have followed your instructions today and DELETE FROM v_xml_cdr;

It deleted the call records (no old call records displayed in "Call Detailed Records" in FusionPBX).

But it made no changes to the size of the database. I can not explain why.

I was hoping if you could help me out with reducing the size of the Database.
My PBX is running on AWS, on a Fusionpbx from Netspectrum.

Thank you. Kind Regards, Guy.

jsun
Site Admin
Posts: 83
Joined: Tue May 26, 2015 9:52 pm

Re: Clear records from xml_cdr

Postby jsun » Thu May 04, 2017 5:57 am

You would need to execute "vacuum" command. See more details at this link, http://stackoverflow.com/questions/2143 ... from-table.

ozeebrown
Posts: 4
Joined: Sat Nov 05, 2016 8:17 am

Re: Clear records from xml_cdr

Postby ozeebrown » Mon May 08, 2017 12:11 am

Thank you very much. That fixed it.


Return to “General discussion”

Who is online

Users browsing this forum: No registered users and 1 guest