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

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sun Jun 15 12:18:14 CDT 2008


On Sun, Jun 15, 2008 at 11:46:18AM -0400, Mark Hamilton wrote:
> Ok, now I'm confused.. logger reload or no logger reload? I want the
> Master.csv to rotate.

If you use the same logrotate file for both the logs and Master.csv, it
should have a 'logger reload' line, as you must re-open the logs.

E.g: /etc/logrotate.d/asterisk

/var/log/asterisk/debug /var/log/asterisk/messages /var/log/asterisk/full /var/log/asterisk/*_log /var/log/asterisk/cdr-*/Master.csv {
  missingok
  sharedscripts
  postrotate
    asterisk -rx "logger rotate" >/dev/null 2>&1
  endscript
}


But if you have different configuration for the CSV file (e.g: rotate it
by size as well, or daily, unlike the system default, which is weekly),
you can put it in a separate logrotate file, that will not rotate logs.

E.g: 

/var/log/asterisk/debug /var/log/asterisk/messages /var/log/asterisk/full /var/log/asterisk/*_log {
  missingok
  sharedscripts
  postrotate
    asterisk -rx "logger rotate" >/dev/null 2>&1
  endscript
}

/var/log/asterisk/cdr-*/Master.csv {
  daily
  missingok
  sharedscripts
}

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-users mailing list