[asterisk-dev] cdr-custom rotate?

Tony Mountifield tony at softins.clara.co.uk
Sat Aug 9 04:54:02 CDT 2008


In article <006501c8f9ec$b50968f0$1f1c3ad0$@com>,
Venefax <venefax at gmail.com> wrote:
> I have to rotate the Master.csv every 5 minutes, on a heavy loaded system. I
> use cdr-custom. How do I force asterisk to rename the cdr file every 5 mins?
> Is there a way?

It doesn't look as if Asterisk holds the file open, but rather opens it every
time it wants to add a record. So you can just have a cron script that renames
the file whenever you want, and Asterisk should recreate Master.csv the next
time it wants to write a CDR.

Try a crontab entry like this:

*/5 * * * * cd /var/log/asterisk/cdr-custom; mv Master.csv Master`date +'\%FT\%H:\%M'`.csv ; touch Master.csv 

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-dev mailing list