[Asterisk-Users] rotate * log file?
Tzafrir Cohen
tzafrir at cohens.org.il
Sun Sep 11 10:37:44 MST 2005
On Sun, Sep 11, 2005 at 10:26:38AM -0600, Rich Adamson wrote:
>
> Running fc3 with current cvs-head...
>
> Is there a nice way to rotate the /var/log/asterisk/messages file without
> shutting down asterisk?
>
> I'm currently rotating the log files via cron, however my script requires
> asterisk to be shut down, which also kills any outstanding cli sessions
> (eg, asterisk -rvvvvv). Would like to rotate the files without killing
> the cli session. Any reasonable way to accomplish this?
Here's what Debian installs at /etc/logrotate.d/asterisk:
/var/log/asterisk/cdr-csv/Master.csv /var/log/asterisk/debug /var/log/asterisk/event_log /var/log/asterisk/messages {
weekly
missingok
rotate 4
sharedscripts
postrotate
/usr/sbin/invoke-rc.d asterisk logger-reload
endscript
}
Naturally the post-rotate script may differ on your system. logger-reload
is a glorified 'asterisk -rx logger reload' . logrotate is a standard part
of most linux distros.
--
Tzafrir Cohen | tzafrir at jbr.cohens.org.il | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir at cohens.org.il | | best
ICQ# 16849755 | | friend
More information about the asterisk-users
mailing list