...
- Log in to MySQL with mysql -u <user> -p<password> voipnow. The user and password are in the file mentioned above.
Then run the following command. It will delete records older than one year. If you want to delete records older than 2 years, replace 1 with 2.
Shell DELETE FROM ast_cdr WHERE calldate < DATE_SUB(NOW(), INTERVAL 1 YEAR);
DELETE FROM call_history WHERE cr_date < DATE_SUB(NOW(), INTERVAL 1 YEAR);
To exit from MySQL, run:
Shell exit;
Deleting records older than Y months
- Log in to MySQL as explained above.
Then run the following command. It will delete all records older than 6 months.
Shell DELETE FROM ast_cdr WHERE calldate < DATE_SUB(NOW(), INTERVAL 6 MONTH);
DELETE FROM call_history WHERE cr_date < DATE_SUB(NOW(), INTERVAL 6 MONTH);
Related articles
Content by Label | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
hidden | true |
---|
|
...
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.