diff options
Diffstat (limited to 'app-admin/syslog-ng/files/syslog-ng.logrotate')
-rw-r--r-- | app-admin/syslog-ng/files/syslog-ng.logrotate | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/app-admin/syslog-ng/files/syslog-ng.logrotate b/app-admin/syslog-ng/files/syslog-ng.logrotate new file mode 100644 index 0000000..1116846 --- /dev/null +++ b/app-admin/syslog-ng/files/syslog-ng.logrotate @@ -0,0 +1,42 @@ +# $Header: $ +# logrotate config for syslog-ng local logs created by +# - Wolfram Schlich <wschlich@gentoo.org> +# - Klaus Schleicher <ks@pegasus-edv.de> +# Distributed under the terms of the GNU General Public License v2 + +/var/log/messages /var/log/syslog-ng/*.log { + ## save rotated logfiles to another directory + olddir /var/log/syslog-ng.archive + ## rotate daily + daily + ## keep 30 old copies + rotate 30 + ## use .YYYYMMDD instead of .0,.1,.2 etc. + dateext + ## also rotate empty logfiles to strictly retain chronology + ifempty + ## re-create source logfile with original permissions + ## do NOT use copy or copytruncate! + create + ## compress on next logrotate run (e.g. next day) to give + ## programs the chance to close the old logfile + delaycompress + ## compress logfiles + compress + compresscmd /bin/gzip + compressoptions -9 + uncompresscmd /bin/gunzip + ## don't throw an error when a file doesn't exist + missingok + ## reload syslog-ng after rotating all logfiles + sharedscripts + postrotate + /etc/init.d/syslog-ng reload >/dev/null + ## restart mailgraph because mgraph.fifo + ## was closed and reopened upon syslog-ng + ## reload, causing mailgraph to shutdown + if [ -e /etc/init.d/mailgraph ]; then + /etc/init.d/mailgraph restart >/dev/null + fi + endscript +} |