Hello - after receiving a report about low free storage space we noticed that
/var/lib/mysql/asteriskcdrdb uses 6.3G .
cel.ibd uses 6.2G
Is there a way to limit the space used , or prune the file?
Is it normal for the file to be so big?
PS: In freepbx today one of our users tried to use Call Event Logging . that screen got stuck or was just taking forever to display. so perpahs just running that report populate cel.ibd .
I tried to disable the cel module, however we use it in timeconditions…
i always looked at those as logs and as such implemented something akin to below via cron … the first dealing with cdr and the second targeting cel
#!/bin/bash
mysql -D asteriskcdrdb -e "DELETE FROM cdr WHERE calldate < DATE_SUB(NOW(), INTERVAL 365 DAY);"
mysql -D asteriskcdrdb -e "DELETE FROM cel WHERE eventtime < DATE_SUB(NOW(), INTERVAL 90 DAY);"
mysqlcheck --auto-repair --optimize --all-databases
im sure there are some other methods out there but for me cel seems especially chatty for my taste and i rarely have a need to reference it; i would rather have the storage for other things
cel.ibd now uses 212M . Thank you for pointing the direction to solve.
mysql asteriskcdrdb --execute="delete from asteriskcdrdb.cdr where datediff(now(), calldate) > 9" ; # > /dev/null
mysql asteriskcdrdb --execute="delete from asteriskcdrdb.cel where datediff(now(), eventtime) > 9" ;
mysqlcheck --auto-repair --optimize --all-databases