[asterisk-users] cdr-custom/Master.csv rotation

Philipp Kempgen philipp.kempgen at amooma.de
Sun Jun 15 11:34:39 CDT 2008


Mark Hamilton schrieb:

> I'm attempting to use this now as is, but Tzafrir points out that this might
> not rotate Master.csv in /cdr-custom. In such a case, what would I need to
> do?

> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Darryl Dunkin
> Sent: June 14, 2008 11:49 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] cdr-custom/Master.csv rotation
> 
> It's like asking for directions, and someone tells you to drive,
> useless.
> 
> Here is what we do here:
> Create /etc/logrotate.d/asterisk:
> /var/log/asterisk/asterisk-verbose /var/log/asterisk/messages
> /var/log/asterisk/debug /var/log/asterisk/queue_log {
>     daily
>     rotate 7
>     compress
>     missingok
>     notifempty
>     sharedscripts
>     postrotate
>         /usr/local/bin/log_rot_ast
>     endscript
> }
> 
> /usr/local/bin/log_rot_ast contains:
> #!/bin/sh
> /usr/sbin/asterisk -rx 'logger reload' >/dev/null 2>&1

logrotate can be used to rotate any files you want. So just add
a logrotate definition to /etc/logrotate.d/asterisk:

/path/to/my/cdr-custom/Master.csv {
	daily
	rotate 7
	compress
	missingok
	notifempty
}


Grüße,
Philipp Kempgen
-- 
http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
Amooma GmbH - Bachstr. 126 - 56566 Neuwied  ->  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998



More information about the asterisk-users mailing list