Asterisk Logrotate: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
(Created page with 'If you would like to do a logrotate on your Asterisk files create the following file:<br> '''/etc/logrotate.d/asterisk''' <pre> /var/log/asterisk/messages /var/log/asterisk/*log …')
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
If you would like to do a logrotate on your Asterisk files create the following file:<br>
If you would like to do a logrotate on your Asterisk files create the following file
'''/etc/logrotate.d/asterisk'''
<pre>
vi /etc/logrotate.d/asterisk
</pre>
 
Add the following contents.
 
<pre>
<pre>
/var/log/asterisk/messages /var/log/asterisk/*log {
/var/log/asterisk/messages /var/log/asterisk/*log {
   missingok
   missingok
   rotate 5
  notifempty
   rotate 52
   weekly
   weekly
   create 0640 root root
   create 0640 root root

Latest revision as of 05:56, 30 September 2015

If you would like to do a logrotate on your Asterisk files create the following file

vi /etc/logrotate.d/asterisk

Add the following contents.

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