I am trying to set up logroate.conf for weekly, rotate 53, and olddir. On both 11.3 and 11.4 the olddir entry is ignored.
logrotate -v /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file apache2
reading config info for /var/log/apache2/access_log
reading config info for /var/log/apache2/error_log
reading config info for /var/log/apache2/suexec.log
reading config info for /var/log/apache2/ssl_request_log
reading config info for /var/log/apache2/ssl_engine_log
reading config file bacula
reading config info for /var/lib/bacula/log
reading config file mcelog
reading config info for /var/log/mcelog
reading config file mysql
reading config info for /var/log/mysql/mysqld.log
reading config file ntp
reading config info for /var/log/ntp
reading config file ocsinventory-server
reading config info for /var/log/ocsinventory-server/*.log
reading config file rsync
reading config info for /var/log/rsyncd.log
reading config file samba
reading config info for /var/log/samba/log.nmbd
reading config info for /var/log/samba/log.smbd
reading config file syslog
reading config info for /var/log/warn /var/log/messages /var/log/allmessages /var/log/localmessages /var/log/firewall /var/log/acpid /var/log/NetworkManager
reading config info for /var/log/mail /var/log/mail.info /var/log/mail.warn /var/log/mail.err
reading config info for /var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice
reading config file wpa_supplicant
reading config info for /var/log/wpa_supplicant.log
reading config file wtmp
reading config info for /var/log/wtmp /var/log/btmp
reading config file xdm
reading config info for /var/log/xdm.errors
reading config file xinetd
reading config info for /var/log/xinetd.log
reading config file zypper.lr
reading config info for /var/log/zypper.log
reading config file zypp-history.lr
reading config info for /var/log/zypp/history
reading config file zypp-refresh.lr
reading config info for /var/log/zypp-refresh.log
compress_prog is now /usr/bin/bzip2
compress_ext was changed to .bz2
uncompress_prog is now /usr/bin/bunzip2
olddir is now /var/log/oldLogs
error: /etc/logrotate.conf:31 duplicate log entry for /var/log/wtmp
error: found error in /var/log/wtmp , skipping
removing last 1 log configs
error: /etc/logrotate.conf:38 duplicate log entry for /var/log/btmp
error: found error in /var/log/btmp , skipping
removing last 1 log configs
Handling 25 logs
rotating pattern: /var/log/apache2/access_log 4194304 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/access_log
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/apache2/error_log 1048576 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/error_log
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/apache2/suexec.log 1048576 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/suexec.log
log /var/log/apache2/suexec.log does not exist -- skipping
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/apache2/ssl_request_log 4194304 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/ssl_request_log
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/apache2/ssl_engine_log 1048576 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/ssl_engine_log
log /var/log/apache2/ssl_engine_log does not exist -- skipping
not running postrotate script, since no logs were rotated
rotating pattern: /var/lib/bacula/log monthly (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/lib/bacula/log
log does not need rotating
rotating pattern: /var/log/mcelog 2097152 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/mcelog
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/mysql/mysqld.log after 1 days (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/mysql/mysqld.log
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/ntp 2097152 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/ntp
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/ocsinventory-server/*.log after 1 days (7 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/ocsinventory-server/activity.log
log does not need rotating
rotating pattern: /var/log/rsyncd.log 1048576 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/rsyncd.log
log /var/log/rsyncd.log does not exist -- skipping
rotating pattern: /var/log/samba/log.nmbd 1048576 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/samba/log.nmbd
log does not need rotating
rotating pattern: /var/log/samba/log.smbd 1048576 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/samba/log.smbd
log does not need rotating
rotating pattern: /var/log/warn /var/log/messages /var/log/allmessages /var/log/localmessages /var/log/firewall /var/log/acpid /var/log/NetworkManager weekly (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/warn
log needs rotating
considering log /var/log/messages
log needs rotating
considering log /var/log/allmessages
log /var/log/allmessages does not exist -- skipping
considering log /var/log/localmessages
log needs rotating
considering log /var/log/firewall
log needs rotating
considering log /var/log/acpid
log needs rotating
considering log /var/log/NetworkManager
log does not need rotating
rotating log /var/log/warn, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/messages, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/localmessages, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/firewall, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/acpid, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/warn to /var/log/warn-20111107
creating new /var/log/warn mode = 0640 uid = 0 gid = 0
renaming /var/log/messages to /var/log/messages-20111107
creating new /var/log/messages mode = 0640 uid = 0 gid = 0
renaming /var/log/localmessages to /var/log/localmessages-20111107
creating new /var/log/localmessages mode = 0640 uid = 0 gid = 0
renaming /var/log/firewall to /var/log/firewall-20111107
creating new /var/log/firewall mode = 0640 uid = 0 gid = 0
renaming /var/log/acpid to /var/log/acpid-20111107
creating new /var/log/acpid mode = 0640 uid = 0 gid = 0
running postrotate script
compressing log with: /bin/gzip
compressing log with: /bin/gzip
compressing log with: /bin/gzip
compressing log with: /bin/gzip
compressing log with: /bin/gzip
rotating pattern: /var/log/mail /var/log/mail.info /var/log/mail.warn /var/log/mail.err weekly (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/mail
log needs rotating
considering log /var/log/mail.info
log needs rotating
considering log /var/log/mail.warn
log needs rotating
considering log /var/log/mail.err
log needs rotating
rotating log /var/log/mail, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/mail.info, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/mail.warn, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/mail.err, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/mail to /var/log/mail-20111107
creating new /var/log/mail mode = 0640 uid = 0 gid = 0
renaming /var/log/mail.info to /var/log/mail.info-20111107
creating new /var/log/mail.info mode = 0640 uid = 0 gid = 0
renaming /var/log/mail.warn to /var/log/mail.warn-20111107
creating new /var/log/mail.warn mode = 0640 uid = 0 gid = 0
renaming /var/log/mail.err to /var/log/mail.err-20111107
creating new /var/log/mail.err mode = 0640 uid = 0 gid = 0
running postrotate script
compressing log with: /bin/gzip
compressing log with: /bin/gzip
compressing log with: /bin/gzip
compressing log with: /bin/gzip
rotating pattern: /var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice weekly (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/news/news.crit
log does not need rotating
considering log /var/log/news/news.err
log does not need rotating
considering log /var/log/news/news.notice
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/wpa_supplicant.log weekly (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/wpa_supplicant.log
log /var/log/wpa_supplicant.log does not exist -- skipping
rotating pattern: /var/log/wtmp /var/log/btmp 409600 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/wtmp
log does not need rotating
considering log /var/log/btmp
log does not need rotating
rotating pattern: /var/log/xdm.errors 4194304 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/xdm.errors
log /var/log/xdm.errors does not exist -- skipping
rotating pattern: /var/log/xinetd.log 2097152 bytes (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/xinetd.log
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/zypper.log weekly (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/zypper.log
log needs rotating
rotating log /var/log/zypper.log, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/zypper.log to /var/log/zypper.log-20111107
compressing log with: /bin/gzip
removing old log /var/log/zypper.log-20110707.gz
rotating pattern: /var/log/zypp/history weekly (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/zypp/history
log needs rotating
rotating log /var/log/zypp/history, log->rotateCount is 53
dateext suffix '-20111107'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/zypp/history to /var/log/zypp/history-20111107
compressing log with: /bin/gzip
rotating pattern: /var/log/zypp-refresh.log weekly (53 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/zypp-refresh.log
log /var/log/zypp-refresh.log does not exist -- skipping
rotating pattern: /var/log/wtmp weekly (53 rotations)
olddir is /var/log/oldLogs, empty log files are rotated, old logs are removed
rotating pattern: /var/log/btmp weekly (53 rotations)
olddir is /var/log/oldLogs, empty log files are rotated, old logs are removed
Logrotate is pulling weekly and rotate from logrotate.conf but none of the old logs are being put in /var/log/oldLogs.
cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 53 weeks worth of backlogs
rotate 53
# create new (empty) log files after rotating old ones
create
# use date as a suffix of the rotated file
dateext
# uncomment this if you want your log files compressed
compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# comment these to switch compression to use gzip or another
# compression scheme
compresscmd /usr/bin/bzip2
uncompresscmd /usr/bin/bunzip2
olddir /var/log/oldLogs
# former versions had to have the compressext set accordingly
#compressext .bz2
# no packages own wtmp and btmp -- we'll rotate them here
/var/log/wtmp {
# monthly
create 0664 root utmp
# minsize 1M
# rotate 1
}
#
/var/log/btmp {
missingok
# monthly
create 0600 root utmp
# rotate 1
}
# system-specific logs may be also be configured here.
cat /etc/logrotate.d/syslog
#
# Please note, that changing of log file permissions in this
# file is not sufficient if syslog-ng is used as log daemon.
#
# It is required to specify the permissions in the syslog-ng
# configuration file /etc/syslog-ng/syslog-ng.conf as well.
#
# the firewall,acpid,NetworkManager log files
# are used by syslog-ng and rsyslog only, the
# other by all syslog daemons.
/var/log/warn /var/log/messages /var/log/allmessages /var/log/localmessages /var/log/firewall /var/log/acpid /var/log/NetworkManager {
compress
dateext
maxage 365
# rotate 99
missingok
notifempty
# size +4096k
create 640 root root
sharedscripts
postrotate
/etc/init.d/syslog reload > /dev/null
endscript
}
# used by all syslog daemons
/var/log/mail /var/log/mail.info /var/log/mail.warn /var/log/mail.err {
compress
dateext
maxage 365
# rotate 99
missingok
notifempty
# size +4096k
create 640 root root
sharedscripts
postrotate
/etc/init.d/syslog reload > /dev/null
endscript
}
# used by all syslog daemons
/var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice {
compress
dateext
maxage 365
# rotate 99
missingok
notifempty
# size +4096k
create 640 news news
sharedscripts
postrotate
/etc/init.d/syslog reload > /dev/null
endscript
}
Does anyone know why olddir is being ignored? Thank you.
Dave W.