Set a new logrotate config (#12).

This commit is contained in:
Jeremy Gardais 2017-09-05 17:04:52 +02:00
parent 8c64644a93
commit 019e4b32db
5 changed files with 116 additions and 82 deletions

View File

@ -1,8 +1,8 @@
/var/log/aptitude { /var/log/aptitude {
rotate 6 rotate 6
weekly monthly
compress compress
missingok missingok
notifempty notifempty
olddir /var/log/old_logs olddir /var/log/aptitude.d
} }

View File

@ -1,22 +1,21 @@
/var/log/dpkg.log { /var/log/dpkg.log {
weekly monthly
rotate 12 rotate 12
compress compress
delaycompress delaycompress
missingok missingok
notifempty notifempty
create 644 root root create 644 root root
olddir /var/log/old_logs olddir /var/log/dpkg
} }
/var/log/alternatives.log { /var/log/alternatives.log {
weekly monthly
rotate 12 rotate 12
compress compress
delaycompress delaycompress
missingok missingok
notifempty notifempty
create 644 root root create 644 root root
olddir /var/log/old_logs olddir /var/log/alternatives
} }

View File

@ -8,7 +8,7 @@ rotate 4
# create new (empty) log files after rotating old ones # create new (empty) log files after rotating old ones
create create
# uncomment this if you want your log files compressed # old versions of log files are compressed with gzip
compress compress
# compress only from the second log file # compress only from the second log file
@ -17,26 +17,27 @@ delaycompress
# use date as a suffix of the rotated file # use date as a suffix of the rotated file
dateext dateext
# do not rotate the log if it is empty
notifempty
# packages drop log rotation information into this directory # packages drop log rotation information into this directory
include /etc/logrotate.d include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here # no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp { /var/log/wtmp {
missingok rotate 3
notifempty
monthly monthly
missingok
create 0664 root utmp create 0664 root utmp
olddir /var/log/old_logs olddir /var/log/old_logs
rotate 3
} }
/var/log/btmp { /var/log/btmp {
missingok
notifempty
monthly monthly
create 0664 root utmp
olddir /var/log/old_logs
rotate 3 rotate 3
missingok
create 0660 root utmp
olddir /var/log/old_logs
} }
# system-specific logs may be configured here # system-specific logs may be configured here

View File

@ -1,20 +1,7 @@
# Ensure to rotate all log files (old and new logpath from Rsyslog) # Default directives are activilly used, please see /etc/logrotate.conf
/var/log/syslog/syslog
/var/log/syslog/syslog.log
/var/log/syslog/daemon.log
/var/log/syslog/local0.log
/var/log/syslog/local1.log
/var/log/syslog/local2.log
/var/log/syslog/local3.log
/var/log/syslog/local4.log
/var/log/syslog/local5.log
/var/log/syslog/local6.log
/var/log/syslog/local7.log
/var/log/syslog/uucp.log
/var/log/syslog /var/log/syslog
/var/log/syslog.log /var/log/syslog.log
/var/log/daemon.log
/var/log/local0.log /var/log/local0.log
/var/log/local1.log /var/log/local1.log
/var/log/local2.log /var/log/local2.log
@ -28,48 +15,92 @@
rotate 7 rotate 7
daily daily
missingok missingok
notifempty olddir /var/log/syslog.d
compress
delaycompress
postrotate postrotate
invoke-rc.d rsyslog rotate > /dev/null invoke-rc.d rsyslog rotate > /dev/null
endscript endscript
} }
/var/log/cron/cron.log
/var/log/cron/mark.log
/var/log/kernel/kern.log
/var/log/kernel/kernel.log
/var/log/lpr/lpr.log
/var/log/mail/*.log
/var/log/security/auth.log
/var/log/security/authpriv.log
/var/log/security/user.log
/var/log/messages/messages
/var/log/news/news.log
/var/log/cron.log /var/log/cron.log
/var/log/mark.log /var/log/mark.log
/var/log/kern.log
/var/log/kernel.log
/var/log/lpr.log
/var/log/mail.log
/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/auth.log
/var/log/authpriv.log
/var/log/user.log
/var/log/messages
/var/log/debug
{ {
rotate 4
maxsize 250k maxsize 250k
weekly
missingok missingok
notifempty
compress
delaycompress
sharedscripts sharedscripts
olddir /var/log/cron
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
/var/log/daemon.log
{
maxsize 250k
missingok
sharedscripts
olddir /var/log/daemon
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
/var/log/kern.log
/var/log/kernel.log
{
maxsize 250k
missingok
sharedscripts
olddir /var/log/kern
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
/var/log/lpr.log
{
maxsize 250k
missingok
sharedscripts
olddir /var/log/lpr
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
/var/log/mail.log
/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
{
maxsize 250k
missingok
sharedscripts
olddir /var/log/mail
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
/var/log/auth.log
/var/log/authpriv.log
/var/log/user.log
{
maxsize 250k
missingok
sharedscripts
olddir /var/log/auth
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}
/var/log/messages
/var/log/debug
{
maxsize 250k
missingok
sharedscripts
olddir /var/log/messages.d
postrotate postrotate
invoke-rc.d rsyslog rotate > /dev/null invoke-rc.d rsyslog rotate > /dev/null
endscript endscript

View File

@ -46,7 +46,10 @@ cp "${LOGROTATE_APTITUDE_CONF}" "${LOGROTATE_APTITUDE_FILE}"
cp "${LOGROTATE_DPKG_CONF}" "${LOGROTATE_DPKG_FILE}" cp "${LOGROTATE_DPKG_CONF}" "${LOGROTATE_DPKG_FILE}"
# Create an archive directory for some log files (aptitude, dpkg,…) # Create an archive directory for some log files (aptitude, dpkg,…)
mkdir -p -- /var/log/old_logs mkdir -p -- /var/log/old_logs /vaar/log/aptitude.d /var/log/dpkg /var/log/alternatives /var/log/syslog.d /var/log/cron /var/log/daemon /var/log/kern /var/log/lpr /var/log/mail /var/log/auth /var/log/messages
chmod 0750 /var/log/auth /var/log/daemon /var/log/kern /var/log/messages /var/log/syslog.d
chown root:adm /var/log/auth /var/log/daemon /var/log/kern /var/log/messages /var/log/syslog.d
# Create the log directory for journald (Systemd), need the configuration Storage=(auto|persistent) # Create the log directory for journald (Systemd), need the configuration Storage=(auto|persistent)
mkdir -p -- /var/log/journal mkdir -p -- /var/log/journal