[asterisk-users] Asterisk Log rotate not working

Jim Lucas lists at cmsws.com
Tue May 21 14:28:31 CDT 2013


On 5/21/2013 11:54 AM, Ahmed Munir wrote:
> Checked in /var/logs/ directory, all logs are not rotating by logrotate.
> Please advise how can I overcome this issue as I'm using CentoOS 5

Ahmed,

Proper log rotation depends on a couple things working together 
correctly to get the job done.  First, you need to make sure you have 
the space to rotate the logs.  If you have compression enabled, 
logrotate creates a copy of the file(s) as it compresses them.  You 
could be running out of space???

Next you need to verify that everything is in place, follow these steps 
to do so.  Keep in mind that I have CentOS 6.4.  So the packages might 
differ a little in the name and surely in the version numbering.

  1) Verify logrotate is installed to your system.
     # yum install logrotate

     if it asks you to install it, do so.

  2) Verify that crond is installed and running.
     Below is the output I get when searching yum to see if crond is 
installed.  If your query returns nothing then crond is not installed.

   [root at jim etc]# yum list all | grep ^cron | grep "@"
   cronie.x86_64                             1.4.4-7.el6 
    @anaconda-CentOS-201303020151.x86_64/6.4
   cronie-anacron.x86_64                     1.4.4-7.el6 
    @anaconda-CentOS-201303020151.x86_64/6.4
   crontabs.noarch                           1.10-33.el6 
    @anaconda-CentOS-201303020151.x86_64/6.4

     If crond is not installed, then you will need to install it.  Once 
you have it installed, move on to the next step.

  3) Make sure crond is setup to start at boot time.

   chkconfig crond on

  4) Verify that logrotate is in one of the cron include folders.  Mine 
is located in the cron.daily folder.

   [root at jim etc]# find /etc/*/logrotate
   /etc/cron.daily/logrotate

   If you don't find that the above file exists, you might need to 
re-install logrotate.

Next I would've had you verify that you have a config file in 
/etc/logrotate.d/ for the asterisk log files.  But it seems you already 
to.  After all this, if it still isn't working, double check all the 
steps above.

Let us know if this does or doesn't help.

--
Jim Lucas



More information about the asterisk-users mailing list