Summary:ASTERISK-12388: [patch] logrotate script for contrib/scripts
Reporter:Paul Belanger (pabelanger)Labels:
Date Opened:2008-07-15 16:54:30Date Closed:2008-07-23 12:17:22
Versions:Frequency of
Environment:Attachments:( 0) logrotate
Description:Here's a simple script we use to rotate our log files every week.  It's based of the default apache logrotate.d for ubuntu.


If it makes its way into contrib, I also may submit a patch to install it when 'make samples' is created.  But feedback maybe need for that.
Comments:By: Michiel van Baak (mvanbaak) 2008-07-15 16:57:43

what about /var/log/asterisk/cdr-csv/Master.csv ?

By: Paul Belanger (pabelanger) 2008-07-15 17:04:22

mvanbaak: Adding it now. Will also add any other file asterisk puts into /var/log/asterisk

By: Tilghman Lesher (tilghman) 2008-07-15 17:08:01

We already have similar functionality within Asterisk.  Just set rotatestrategy=rotate and exec_after_rotate=...

See the sample logger.conf for more information.

By: Paul Belanger (pabelanger) 2008-07-15 17:55:18

Corydon76: Some problems, it seems running 'logger rotate' from my cli causes asterisk to spike to 99% cpu usage.  I'm checking to see why not.  Either way, I'll submit a new bug report if / when I find the problem.

By: Paul Belanger (pabelanger) 2008-07-16 08:36:10

Managed to get 'logger rotate' working.  If this is the recommended way to rotate logs, then we can close out this patch.

The bonus, with this patch, is using logrotate to execute the rotations hourly, weekly, or monthly.  Not to say asterisk cannot do it. :)

By: Tilghman Lesher (tilghman) 2008-07-23 12:17:21

Committed in revision 132977