logrotate ignors olddir in logroate.conf

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.

On 11/07/2011 08:56 PM, dwestf wrote:
> Does anyone know why olddir is being ignored?

note: i’m neither a programmer nor script writer so, i might not be so
helpful…but, let me ask you some questions (i can’t see into your
head, and you have not declared, so i really have zero idea how advanced
is your knowledge of Linux in general nor setting up logrotate in
specific and therefore any of my questions might sound like i think
you don’t know what you are doing…which is not at all the point of any
question):

-"/var/log/oldLogs" and “/var/log/oldlogs” are not the same, right?

-i see the output of running “logrotate -v /etc/logrotate.conf” but i do
not see the contents of /etc/logrotate.conf itself, which is where i
imagine the problem may be…

-in your post, the first time i find “olddir” it seems to be an english
statement “olddir is now /var/log/oldLogs” rather than something in a
programming like statement (like maybe alias ‘olddir=/var/log/oldLogs’)
which is kinda confusing to me…and, i therefore wonder if it is also
‘confusing’ logrotate, and i wonder how (in logrotate.conf??) you set up
/var/log/oldLogs to be the place for old logs to live…

-and, immediately after that first encounter of “olddir” in your post i
see four error messages and wonder what caused them, and if fixing
that problem will answer your question…maybe not, so:

-does the directory /var/log/oldLogs exist?

-is it populated?

-can the user running logrotate (probably ‘root’, right?) both read and
write to that directory?

-why go to the trouble to set up a new directory for the old log files?
i mean, it is normal for them to exist in the same directory with the
current log files (they are not easy to confuse as the current ones
have names like “messages” or “Xorg.0.log” or “wtmp” and the old ones
names like “messages-20110617.bz2” or “Xorg.0.log.old” or
“wtmp-20110713.bz2”?

sorry i can’t directly provide an answer…perhaps someone else can if
they see the contents of logrotate.conf and have confirmed that
/var/log/oldLogs boths exists and is read/writable

on the other hand, perhaps not…perhaps they need other info also…


DD
http://tinyurl.com/DD-Caveat
openSUSE®, the “German Automobiles” of operating systems

On 2011-11-08 10:02, DenverD wrote:

> -i see the output of running “logrotate -v /etc/logrotate.conf” but i do
> not see the contents of /etc/logrotate.conf itself, which is where i
> imagine the problem may be…

It is hiding at the bottom of the post. :slight_smile:

I have never used “olddir”, so I don’t know why it works or not. The
statement is read, I see it in the log. There are some bad (repeated) entries.

There is a curious output:


rotating pattern: /var/log/wtmp  weekly (53 rotations)
olddir is /var/log/oldLogs, empty log files are rotated, old logs are removed


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 11/07/2011 08:56 PM, dwestf wrote:
> cat /etc/logrotate.conf
> [snip]
> olddir /var/log/oldLogs
>

i have no idea why your “olddir /var/log/oldLogs” isn’t doing as you
expect…perhaps you need to creat the dir first???

> # no packages own wtmp and btmp – we’ll rotate them here

hmmmm…i can’t explain why, but on my default installed openSUSE 11.4 i
have a file at /etc/logrotate.d/wtmp which includes:


/var/log/wtmp /var/log/btmp {
compress
dateext
maxage 365
rotate 99
size=+400k
notifempty
missingok
copytruncate
}

so it therefore addresses both the missing elements you edited
logrotate.conf to fix…

perhaps you could use a similar file (modified as you need) to satisfy
your needs?


DD
http://tinyurl.com/DD-Caveat
openSUSE®, the “German Automobiles” of operating systems

On 11/08/2011 12:43 PM, Carlos E. R. wrote:
> It is hiding at the bottom of the post.

stupid me! i looked for it (twice) and didn’t find it!!


DD
openSUSE®, the “German Automobiles” of operating systems

Sorry I thought I put in 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.

/var/log/oldLogs does exist and logrotate is run by root, no other user can write to /var/log. There are two logs that are in logrotate.conf, btmp and wtmp, the rest are in /etc/logrotate.d. This is why you see duplicate for wtmp, it has a file in logrotate.d.

I just did a test. I created the btmp file, and made sure it and an entry, since btmp did show the olddir option in its output. I moved all of the old logs to /var/log/oldLogs. I did a force on logrotate.

logrotate -v -f /etc/logrotate.conf

btmp and messages created gzip’s in /var/log, all other logs were skipped. Even though btmp said it has the option of olddir it did not create its log in /var/log/oldLogs

drwxrwx— 2 root root 4096 Nov 8 07:07 oldLogs/

The reason I want my old logs in a different directory is that I need to keep a years worth. With 53 old files of a dozen or so logs, it becomes hard to see what is going on in /var/log.

Right now I see this as a bug with logrotate. The logs in logrotate.d do not even see the option for olddir, the one in logrotate.conf (btmp) does see the olddir option but ignors it.

Dave W

I had a thought and did some looking. The logrotate.conf I was using from from an older version of openSUSE. I use a script to set up security on my computers here. I went back and found the original logrotate.conf. Let make the changes I need and try again.

Dave W

It was logrotate.conf.


cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 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

# comment these to switch compression to use gzip or another
# compression scheme
compresscmd /usr/bin/bzip2
uncompresscmd /usr/bin/bunzip2

# former versions had to have the compressext set accordingly
#compressext .bz2


olddir /var/log/oldLogs

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d


logrotate -v /etc/logrotate.conf 
reading config file /etc/logrotate.conf
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
including /etc/logrotate.d
reading config file mysql
reading config info for /var/log/mysql/mysqld.log 
error: mysql:44 error verifying log file path /var/log/mysql: No such file or directory
error: found error in file mysql, skipping
removing last 1 log configs
reading config file ntp
reading config info for /var/log/ntp 
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 

Handling 15 logs

rotating pattern: /var/log/mysql/mysqld.log  after 1 days (53 rotations)
olddir is /var/log/oldLogs, empty log files are not rotated, old logs are removed
considering log /var/log/mysql/mysqld.log
  log /var/log/mysql/mysqld.log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/ntp  2097152 bytes (53 rotations)
olddir is /var/log/oldLogs, 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/rsyncd.log  1048576 bytes (53 rotations)
olddir is /var/log/oldLogs, 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)
olddir is /var/log/oldLogs, empty log files are not rotated, old logs are removed
considering log /var/log/samba/log.nmbd
  log /var/log/samba/log.nmbd does not exist -- skipping

rotating pattern: /var/log/samba/log.smbd  1048576 bytes (53 rotations)
olddir is /var/log/oldLogs, empty log files are not rotated, old logs are removed
considering log /var/log/samba/log.smbd
  log /var/log/samba/log.smbd does not exist -- skipping

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)
olddir is /var/log/oldLogs, 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 does not need rotating
considering log /var/log/acpid
  log needs rotating
considering log /var/log/NetworkManager
  log needs rotating
rotating log /var/log/warn, log->rotateCount is 53
dateext suffix '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
rotating log /var/log/messages, log->rotateCount is 53
dateext suffix '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
rotating log /var/log/localmessages, log->rotateCount is 53
dateext suffix '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
rotating log /var/log/acpid, log->rotateCount is 53
dateext suffix '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
rotating log /var/log/NetworkManager, log->rotateCount is 53
dateext suffix '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/warn to /var/log/oldLogs/warn-20111108
creating new /var/log/warn mode = 0640 uid = 0 gid = 0
renaming /var/log/messages to /var/log/oldLogs/messages-20111108
creating new /var/log/messages mode = 0640 uid = 0 gid = 0
renaming /var/log/localmessages to /var/log/oldLogs/localmessages-20111108
creating new /var/log/localmessages mode = 0640 uid = 0 gid = 0
renaming /var/log/acpid to /var/log/oldLogs/acpid-20111108
creating new /var/log/acpid mode = 0640 uid = 0 gid = 0
renaming /var/log/NetworkManager to /var/log/oldLogs/NetworkManager-20111108
creating new /var/log/NetworkManager mode = 0640 uid = 0 gid = 0
running postrotate script
compressing log with: /usr/bin/bzip2
compressing log with: /usr/bin/bzip2
compressing log with: /usr/bin/bzip2
compressing log with: /usr/bin/bzip2
compressing log with: /usr/bin/bzip2

rotating pattern: /var/log/mail /var/log/mail.info /var/log/mail.warn /var/log/mail.err  weekly (53 rotations)
olddir is /var/log/oldLogs, 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 '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
rotating log /var/log/mail.info, log->rotateCount is 53
dateext suffix '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
rotating log /var/log/mail.warn, log->rotateCount is 53
dateext suffix '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
rotating log /var/log/mail.err, log->rotateCount is 53
dateext suffix '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/mail to /var/log/oldLogs/mail-20111108
creating new /var/log/mail mode = 0640 uid = 0 gid = 0
renaming /var/log/mail.info to /var/log/oldLogs/mail.info-20111108
creating new /var/log/mail.info mode = 0640 uid = 0 gid = 0
renaming /var/log/mail.warn to /var/log/oldLogs/mail.warn-20111108
creating new /var/log/mail.warn mode = 0640 uid = 0 gid = 0
renaming /var/log/mail.err to /var/log/oldLogs/mail.err-20111108
creating new /var/log/mail.err mode = 0640 uid = 0 gid = 0
running postrotate script
compressing log with: /usr/bin/bzip2
compressing log with: /usr/bin/bzip2
compressing log with: /usr/bin/bzip2
compressing log with: /usr/bin/bzip2

rotating pattern: /var/log/news/news.crit /var/log/news/news.err /var/log/news/news.notice  weekly (53 rotations)
olddir is /var/log/oldLogs, 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)
olddir is /var/log/oldLogs, empty log files are not rotated, old logs are removed
considering log /var/log/wpa_supplicant.log
  log does not need rotating

rotating pattern: /var/log/wtmp /var/log/btmp  409600 bytes (53 rotations)
olddir is /var/log/oldLogs, 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)
olddir is /var/log/oldLogs, 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)
olddir is /var/log/oldLogs, empty log files are not rotated, old logs are removed
considering log /var/log/xinetd.log
  log /var/log/xinetd.log does not exist -- skipping
not running postrotate script, since no logs were rotated

rotating pattern: /var/log/zypper.log  weekly (53 rotations)
olddir is /var/log/oldLogs, 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 '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/zypper.log to /var/log/oldLogs/zypper.log-20111108
compressing log with: /usr/bin/bzip2

rotating pattern: /var/log/zypp/history  weekly (53 rotations)
olddir is /var/log/oldLogs, 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 '-20111108'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
renaming /var/log/zypp/history to /var/log/oldLogs/history-20111108
compressing log with: /usr/bin/bzip2

rotating pattern: /var/log/zypp-refresh.log  weekly (53 rotations)
olddir is /var/log/oldLogs, 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


ls /var/log/oldLogs/
acpid-20111108.bz2    localmessages-20111108.bz2  mail.err-20111108.bz2   mail.warn-20111108.bz2  NetworkManager-20111108.bz2  zypper.log-20111108.bz2
history-20111108.bz2  mail-20111108.bz2           mail.info-20111108.bz2  messages-20111108.bz2   warn-20111108.bz2

I think I see why olddir was not being used. I just did grep -v “#” on the logrotate.conf of the file I was using which gives a cleaner version to look at. The olddir entry is after the include entry. This explains why the logs in logrotated.d did not get the olddir option. This must be a change in the version of logroate. This worked on the 11.1 and 11.2 version of openSUSE. Thanks for the help. Sometimes you need another pair of eyes to get you to look in the right spot.

Dave W

On 2011-11-08 13:56, dwestf wrote:
>
> I had a thought and did some looking. The logrotate.conf I was using
> from from an older version of openSUSE. I use a script to set up
> security on my computers here. I went back and found the original
> logrotate.conf. Let make the changes I need and try again.

I thought you had an old config, yes. I should have said it.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 11/08/2011 02:38 PM, Carlos E. R. wrote:
> I thought you had an old config, yes. I should have said it.

unfortunately, things change and the old stuff doesn’t work any
more…WAIT a second, fortunately folks are still improving Linux and
old stuff doesn’t always work…(probably if you or me or the man in
the moon looked there are some release notes somewhere about how
logrotate has changed and . . .

HAPPY you got sorted out…


DD
openSUSE®, the “German Automobiles” of operating systems