[Asterisk-Users] How to prevent log files from eating my hard drive?

Samy Antoun samyantoun at yahoo.com
Tue Jul 5 10:55:23 MST 2005


> Somehow, Asterisk log files are consuming all the
> space that I have in 
> my hard disk...  They've already eaten 14GB and are
> still hungry!!  What 
> shall I do?  I'm not even logging anything in
> verbose mode!!

Leo,
This can be done through editing of
/etc/logrotate.d/asterisk. This file contains a script
of log rotation. This is a sample file:

/var/log/asterisk/*log {
   missingok
   rotate 5
   weekly
   create 0640 asterisk asterisk
   postrotate
       /usr/sbin/asterisk -rx 'logger reload' >
/dev/null 2> /dev/null
   endscript
}

As you can see, the "rotate 5" means that it will keep
5 old files, you can reduce that number to 2 or 3 to
save some space.

Another thing you can do to save a LOT of space is to
change "weekly" to "daily", this way you will keep
only ONE DAY of logging data in the file.

Third thing you can do is to add "compress" statement
to the script, this will compress the old files.

I think if you'll combine those 3 options, you going
to have a log files that is almost 10% of what you
have now.

Regards.

Samy


		
____________________________________________________ 
Yahoo! Sports 
Rekindle the Rivalries. Sign up for Fantasy Football 
http://football.fantasysports.yahoo.com



More information about the asterisk-users mailing list