How to limit the number of call record in CDR file

452 Views Asked by At

My call records are getting store in /var/log/asterisk/cdr-csv/Master.csv file. i want to limit the number of call to be stored ni this file, after that it should start form the beginning, so for this what could be procedure

1

There are 1 best solutions below

0
arheops On

You can't limit number of records by asterisk

But you easy can rotate files by using logrotate linux utility.

For that you should create file /etc/logrotate.d/asterisk_cdr

/var/log/asterisk/cdr-csv/*csv {
missingok
rotate 5
size 2000k
create 0640 asterisk asterisk
}

For more info see documentation for logrotated