Log rotation not happening in our Fedora 31 server, MySQL entries in logrotate.status

/etc/logrotate.conf is set as below:

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# 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

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

# system-specific logs may be also be configured here.

logrotate was upgraded by dnf on 12/25/2019.

grep logrotate /var/log/messages
Dec 25 09:52:06 storm dnf[1777]: logrotate                                     x86_643.15.1-1.fc31                       fedora         73 k
Dec 25 09:55:08 storm dnf[1777]:  Running scriptlet: logrotate-3.15.1-1.fc31.x86_64                    662/5141
Dec 25 09:55:08 storm dnf[1777]:  Upgrading        : logrotate-3.15.1-1.fc31.x86_64                    662/5141
Dec 25 09:55:08 storm dnf[1777]:  Running scriptlet: logrotate-3.15.1-1.fc31.x86_64                    662/5141
Dec 25 10:01:26 storm dnf[1777]:  Running scriptlet: logrotate-3.15.1-1.fc30.x86_64                   3629/5141
Dec 25 10:01:26 storm dnf[1777]:  Cleanup          : logrotate-3.15.1-1.fc30.x86_64                   3629/5141

Here’s what’s really odd. Check out the first few entries of the status file:

-rw-r--r-- 1 root root 11820 Dec  9 12:16 logrotate.status
cat /var/lib/logrotate/logrotate.status
    logrotate state -- version 2
"`dl`" 2019-9-9-9:0:0
"(`User`)" 2019-9-9-9:0:0
"`Create_priv`" 2019-9-9-9:0:0
"timestamp" 2019-9-9-9:0:0
"`column_stats`" 2019-9-9-9:0:0
"(`Book_id`)," 2019-9-9-9:0:0
"`Membership`" 2019-9-9-9:0:0
"`HeadBy_ibfk_1`" 2019-9-9-9:0:0
"`DueDate`" 2019-9-9-9:0:0
"`bankaccount_ibfk_1`" 2019-9-9-9:0:0
"(`S_Number`)" 2019-9-9-9:0:0
"`FP_PaymentMethod`" 2019-9-9-9:0:0
"`Bill_Address`" 2019-9-9-9:0:0
"`mem_address`" 2019-9-9-9:0:0
"`lib_address`" 2019-9-9-9:0:0
"`cardholder`" 2019-9-9-9:0:0
"`copy_ibfk_3`" 2019-9-9-9:0:0
"(2010-01-01,Writing Skills,1st,Addison Wesley,30,0-1153-2555-5,10,Arts,Matt Florence),(2000-01-01,Fundamentals of Database Systems,3rd,Addison Wesley,100,0-8053-1755-4,20,Sciences,Ramez A. Elmasri and Shamkant Navathe),(2003-01-01,Database Management Systems,3rd,McGraw-Hill,110,978-0-07-246563-1,15,Sciences,Raghu Ramakrishanan and Johannes Gehrke),(2011-01-01,Data Mining, Practical Machine Learning Tools and Techniques,3rd,Elsevier,120,978-0-12-374856-0,25,Sciences,Ian H. Witten, Eibe Frank, and Mark Hall\\n);" 2019-9-9-9:0:0
"Written_ibfk_1" 2019-9-9-9:0:0

Those look like entries in a MySQL database used in classes. And then it ends with the expected log files to be rotated:

"/var/log/httpd/flask-error.log" 2019-12-9-12:11:36
"/var/log/messages" 2019-12-9-12:11:36
"/var/log/httpd/access_log" 2019-12-9-12:11:36
"/var/account/pacct" 2019-9-11-9:0:0
"/var/log/cron" 2019-12-9-12:11:36

Running logrotate manually works just fine. What’s the fix here?

logrotate --debug /etc/logrotate.conf
:flying_saucer: Use the Wiki, Luke!

The database entires in logrotate.status really do appear to be out of place. The timestamps look like miscast data: 2019-9-9-9:0:0.

Suggest:
checking history (fc -l 1 # or some number near to the beginning of the history) for manual logrotate commands.
checking /etc/logrotate.d for mysql related instructions.

I removed all of those MySQL entries from the status file and here’s the debug result:

    WARNING: logrotate in debug mode does nothing except printing debug messages!  Consider using verbose mode (-v) instead if this is not what you want.

    reading config file /etc/logrotate.conf
    including /etc/logrotate.d
    reading config file apcupsd
    reading config file bootlog
    reading config file btmp
    reading config file chrony
    reading config file clamav-unofficial-sigs
    reading config file clamav-update
    reading config file cups
    reading config file dnf
    reading config file fail2ban
    reading config file firebird
    reading config file glusterfs
    reading config file httpd
    reading config file iodine-client
    reading config file iscsiuiolog
    reading config file libvirtd
    reading config file libvirtd.qemu
    reading config file lightdm
    reading config file mariadb
    reading config file munge
    reading config file numad
    reading config file php-fpm
    reading config file ppp
    reading config file psacct
    reading config file rsyslog
    reading config file samba
    olddir is now /var/log/samba/old
    reading config file sa-update
    reading config file sssd
    reading config file wpa_supplicant
    reading config file wtmp
    Reading state from file: /var/lib/logrotate/logrotate.status
    Allocating hash table for state file, size 64 entries
    Creating new state
[...]
    Handling 31 logs

    rotating pattern: /var/log/apcupsd.events  weekly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/apcupsd.events
      log /var/log/apcupsd.events does not exist -- skipping

    rotating pattern: /var/log/boot.log
     after 1 days (7 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/boot.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/boot.log, log->rotateCount is 7
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    copying /var/log/boot.log to /var/log/boot.log-20200114
    truncating /var/log/boot.log
    compressing log with: /bin/gzip

    rotating pattern: /var/log/btmp  monthly (1 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/btmp
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/btmp, log->rotateCount is 1
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    renaming /var/log/btmp to /var/log/btmp-20200114
    creating new /var/log/btmp mode = 0660 uid = 0 gid = 22
    compressing log with: /bin/gzip
    removing old log /var/log/btmp-20191209.gz

    rotating pattern: /var/log/chrony/*.log  weekly (4 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/chrony/*.log
      log /var/log/chrony/*.log does not exist -- skipping
    not running postrotate script, since no logs were rotated

    rotating pattern: /var/log/clamav-unofficial-sigs/clamav-unofficial-sigs.log  weekly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/clamav-unofficial-sigs/clamav-unofficial-sigs.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/clamav-unofficial-sigs/clamav-unofficial-sigs.log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    renaming /var/log/clamav-unofficial-sigs/clamav-unofficial-sigs.log to /var/log/clamav-unofficial-sigs/clamav-unofficial-sigs.log-20200114
    creating new /var/log/clamav-unofficial-sigs/clamav-unofficial-sigs.log mode = 0640 uid = 985 gid = 981
    compressing log with: /bin/gzip
    removing old log /var/log/clamav-unofficial-sigs/clamav-unofficial-sigs.log-20190911.gz

    rotating pattern: /var/log/freshclam.log  monthly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/freshclam.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-09-11 09:00
      log does not need rotating (log is empty)

    rotating pattern: /var/log/cups/*_log  weekly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/cups/access_log
      Now: 2020-01-14 14:02
      Last rotated at 2019-11-11 09:40
      log needs rotating
    considering log /var/log/cups/error_log
      Now: 2020-01-14 14:02
      Last rotated at 2019-11-11 09:40
      log needs rotating
    considering log /var/log/cups/page_log
      Now: 2020-01-14 14:02
      Last rotated at 2019-11-11 09:40
      log needs rotating
    rotating log /var/log/cups/access_log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    rotating log /var/log/cups/error_log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    rotating log /var/log/cups/page_log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    renaming /var/log/cups/access_log to /var/log/cups/access_log-20200114
    creating new /var/log/cups/access_log mode = 0600 uid = 0 gid = 7
    renaming /var/log/cups/error_log to /var/log/cups/error_log-20200114
    creating new /var/log/cups/error_log mode = 0600 uid = 0 gid = 7
    renaming /var/log/cups/page_log to /var/log/cups/page_log-20200114
    creating new /var/log/cups/page_log mode = 0600 uid = 0 gid = 7
    compressing log with: /bin/gzip
    compressing log with: /bin/gzip
    compressing log with: /bin/gzip

    rotating pattern: /var/log/dnf.librepo.log  weekly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/dnf.librepo.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/dnf.librepo.log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    renaming /var/log/dnf.librepo.log to /var/log/dnf.librepo.log-20200114
    creating new /var/log/dnf.librepo.log mode = 0600 uid = 0 gid = 0
    compressing log with: /bin/gzip

    rotating pattern: /var/log/hawkey.log  weekly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/hawkey.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/hawkey.log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    renaming /var/log/hawkey.log to /var/log/hawkey.log-20200114
    creating new /var/log/hawkey.log mode = 0600 uid = 0 gid = 0
    compressing log with: /bin/gzip

    rotating pattern: /var/log/fail2ban.log  weekly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/fail2ban.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/fail2ban.log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    renaming /var/log/fail2ban.log to /var/log/fail2ban.log-20200114
    creating new /var/log/fail2ban.log mode = 0644 uid = 0 gid = 0
    running postrotate script
    running script with args /var/log/fail2ban.log /var/log/fail2ban.log-20200114: "
          /usr/bin/fail2ban-client flushlogs >/dev/null || true
    "
    compressing log with: /bin/gzip

    rotating pattern: /var/log/firebird/firebird.log  weekly (52 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/firebird/firebird.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-09-11 09:54
      log does not need rotating (log is empty)

    rotating pattern: /var/log/glusterfs/*.log  weekly (26 rotations)
    empty log files are not rotated, only log files >= 102400 bytes are rotated, log files >= 10485760 are rotated earlier, old logs are removed
    considering log /var/log/glusterfs/cli.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-09-11 09:54
      log does not need rotating ('minsize' directive is used and the log size is smaller than the minsize value)
    not running postrotate script, since no logs were rotated

    rotating pattern: /var/log/glusterfs/bricks/*.log  weekly (26 rotations)
    empty log files are not rotated, only log files >= 102400 bytes are rotated, log files >= 10485760 are rotated earlier, old logs are removed
    considering log /var/log/glusterfs/bricks/*.log
    not running postrotate script, since no logs were rotated

    rotating pattern: /var/log/glusterfs/samples/*.samp  after 1 days (3 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/glusterfs/samples/*.samp

    rotating pattern: /var/log/httpd/*log  weekly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/httpd/access_log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/httpd/error_log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/httpd/flask-access.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-11-11 09:00
      log does not need rotating (log is empty)
    considering log /var/log/httpd/flask-error.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log does not need rotating (log is empty)
    considering log /var/log/httpd/modsec_audit.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/httpd/modsec_debug.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-09-11 09:00
      log does not need rotating (log is empty)
    considering log /var/log/httpd/ssl_access_log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/httpd/ssl_error_log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/httpd/ssl_request_log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/httpd/access_log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    rotating log /var/log/httpd/error_log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    rotating log /var/log/httpd/modsec_audit.log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    rotating log /var/log/httpd/ssl_access_log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    rotating log /var/log/httpd/ssl_error_log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    rotating log /var/log/httpd/ssl_request_log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    renaming /var/log/httpd/access_log to /var/log/httpd/access_log-20200114
    creating new /var/log/httpd/access_log mode = 0644 uid = 0 gid = 0
    renaming /var/log/httpd/error_log to /var/log/httpd/error_log-20200114
    creating new /var/log/httpd/error_log mode = 0644 uid = 0 gid = 0
    renaming /var/log/httpd/modsec_audit.log to /var/log/httpd/modsec_audit.log-20200114
    creating new /var/log/httpd/modsec_audit.log mode = 0640 uid = 0 gid = 0
    renaming /var/log/httpd/ssl_access_log to /var/log/httpd/ssl_access_log-20200114
    creating new /var/log/httpd/ssl_access_log mode = 0644 uid = 0 gid = 0
    renaming /var/log/httpd/ssl_error_log to /var/log/httpd/ssl_error_log-20200114
    creating new /var/log/httpd/ssl_error_log mode = 0644 uid = 0 gid = 0
    renaming /var/log/httpd/ssl_request_log to /var/log/httpd/ssl_request_log-20200114
    creating new /var/log/httpd/ssl_request_log mode = 0644 uid = 0 gid = 0
    running postrotate script
    running script with args /var/log/httpd/*log  (null): "
            /bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
    "

    rotating pattern: /var/log/iodine-client.log  weekly (4 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/iodine-client.log
      log /var/log/iodine-client.log does not exist -- skipping

    rotating pattern: /var/log/iscsiuio.log  weekly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/iscsiuio.log
      log /var/log/iscsiuio.log does not exist -- skipping
    not running postrotate script, since no logs were rotated

    rotating pattern: /var/log/libvirt/libvirtd.log  weekly (4 rotations)
    empty log files are rotated, only log files >= 102400 bytes are rotated, old logs are removed
    considering log /var/log/libvirt/libvirtd.log
      log /var/log/libvirt/libvirtd.log does not exist -- skipping

    rotating pattern: /var/log/libvirt/qemu/*.log  2097153 bytes (4 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/libvirt/qemu/*.log
      log /var/log/libvirt/qemu/*.log does not exist -- skipping

    rotating pattern: /var/log/mariadb/mariadb.log  after 1 days (3 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/mariadb/mariadb.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/mariadb/mariadb.log, log->rotateCount is 3
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    renaming /var/log/mariadb/mariadb.log to /var/log/mariadb/mariadb.log-20200114
    creating new /var/log/mariadb/mariadb.log mode = 0600 uid = 27 gid = 27
    running postrotate script
    running script with args /var/log/mariadb/mariadb.log /var/log/mariadb/mariadb.log-20200114: "
            # just if mysqld is really running
            if [ -e /run/mariadb/mariadb.pid ]
            then
               kill -1 $(</run/mariadb/mariadb.pid)
            fi
    "
    compressing log with: /bin/gzip

    rotating pattern: /var/log/munge/munged.log  weekly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/munge/munged.log
      log /var/log/munge/munged.log does not exist -- skipping

    rotating pattern: /var/log/numad.log  1048576 bytes (5 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/numad.log
      log /var/log/numad.log does not exist -- skipping

    rotating pattern: /var/log/php-fpm/*log  weekly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/php-fpm/error.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/php-fpm/www-error.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/php-fpm/error.log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    rotating log /var/log/php-fpm/www-error.log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    renaming /var/log/php-fpm/error.log to /var/log/php-fpm/error.log-20200114
    creating new /var/log/php-fpm/error.log mode = 0600 uid = 0 gid = 0
    renaming /var/log/php-fpm/www-error.log to /var/log/php-fpm/www-error.log-20200114
    creating new /var/log/php-fpm/www-error.log mode = 0644 uid = 48 gid = 48
    running postrotate script
    running script with args /var/log/php-fpm/*log  (null): "
            /bin/kill -SIGUSR1 `cat /run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
    "

    rotating pattern: /var/log/ppp/connect-errors  after 1 days (5 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/ppp/connect-errors
      log /var/log/ppp/connect-errors does not exist -- skipping

    rotating pattern: /var/account/pacct  after 1 days (31 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/account/pacct
      Now: 2020-01-14 14:02
      Last rotated at 2019-09-11 09:00
      log does not need rotating (log is empty)

    rotating pattern: /var/log/cron
    /var/log/maillog
    /var/log/messages
    /var/log/secure
    /var/log/spooler
     weekly (4 rotations)
    empty log files are rotated, old logs are removed
    considering log /var/log/cron
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/maillog
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/messages
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/secure
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/spooler
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/cron, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    rotating log /var/log/maillog, log->rotateCount is 4
    dateext suffix '-20200114'
    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 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    rotating log /var/log/secure, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    rotating log /var/log/spooler, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    renaming /var/log/cron to /var/log/cron-20200114
    creating new /var/log/cron mode = 0600 uid = 0 gid = 0
    renaming /var/log/maillog to /var/log/maillog-20200114
    creating new /var/log/maillog mode = 0600 uid = 0 gid = 0
    renaming /var/log/messages to /var/log/messages-20200114
    creating new /var/log/messages mode = 0600 uid = 0 gid = 0
    renaming /var/log/secure to /var/log/secure-20200114
    creating new /var/log/secure mode = 0600 uid = 0 gid = 0
    renaming /var/log/spooler to /var/log/spooler-20200114
    creating new /var/log/spooler mode = 0600 uid = 0 gid = 0
    running postrotate script
    running script with args /var/log/cron
    /var/log/maillog
    /var/log/messages
    /var/log/secure
    /var/log/spooler
     (null): "
            /usr/bin/systemctl kill -s HUP rsyslog.service >/dev/null 2>&1 || true
            reload rsyslog >/dev/null 2>&1 || true
            /bin/kill -HUP `cat /var/run/sendmailanalyzer.pid`  2>/dev/null || true
    "
    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/samba/log.*  weekly (99 rotations)
    olddir is /var/log/samba/old, empty log files are not rotated, old logs are removed
    considering log /var/log/samba/log.*
      log /var/log/samba/log.* does not exist -- skipping
    Creating new state

    rotating pattern: /var/log/sa-update.log  monthly (4 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/sa-update.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/sa-update.log, log->rotateCount is 4
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    renaming /var/log/sa-update.log to /var/log/sa-update.log-20200114
    creating new /var/log/sa-update.log mode = 0644 uid = 0 gid = 0
    compressing log with: /bin/gzip

    rotating pattern: /var/log/sssd/*.log  weekly (2 rotations)
    empty log files are not rotated, old logs are removed
    considering log /var/log/sssd/sssd_implicit_files.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/sssd/sssd_kcm.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/sssd/sssd.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    considering log /var/log/sssd/sssd_nss.log
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/sssd/sssd_implicit_files.log, log->rotateCount is 2
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    rotating log /var/log/sssd/sssd_kcm.log, log->rotateCount is 2
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    rotating log /var/log/sssd/sssd.log, log->rotateCount is 2
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    rotating log /var/log/sssd/sssd_nss.log, log->rotateCount is 2
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    compressing log with: /bin/gzip
    renaming /var/log/sssd/sssd_implicit_files.log to /var/log/sssd/sssd_implicit_files.log-20200114
    creating new /var/log/sssd/sssd_implicit_files.log mode = 0600 uid = 0 gid = 0
    renaming /var/log/sssd/sssd_kcm.log to /var/log/sssd/sssd_kcm.log-20200114
    creating new /var/log/sssd/sssd_kcm.log mode = 0600 uid = 0 gid = 0
    renaming /var/log/sssd/sssd.log to /var/log/sssd/sssd.log-20200114
    creating new /var/log/sssd/sssd.log mode = 0600 uid = 0 gid = 0
    renaming /var/log/sssd/sssd_nss.log to /var/log/sssd/sssd_nss.log-20200114
    creating new /var/log/sssd/sssd_nss.log mode = 0600 uid = 0 gid = 0
    running postrotate script
    running script with args /var/log/sssd/*.log  (null): "
            /bin/kill -HUP `cat /var/run/sssd.pid  2>/dev/null`  2> /dev/null || true
    "

    rotating pattern: /var/log/wpa_supplicant.log  30720 bytes (4 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  monthly (1 rotations)
    empty log files are rotated, only log files >= 1048576 bytes are rotated, old logs are removed
    considering log /var/log/wtmp
      Now: 2020-01-14 14:02
      Last rotated at 2019-12-09 12:11
      log needs rotating
    rotating log /var/log/wtmp, log->rotateCount is 1
    dateext suffix '-20200114'
    glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    renaming /var/log/wtmp to /var/log/wtmp-20200114
    creating new /var/log/wtmp mode = 0664 uid = 0 gid = 22
    compressing log with: /bin/gzip

So that looks good.

Just these:

789      logrotate -d
790      logrotate -d /etc/logrotate.conf
1468     logrotate -vf /etc/logrotate.conf

Looks like default:

/var/log/mariadb/mariadb.log {
        create 600 mysql mysql
        notifempty
        daily
        rotate 3
        missingok
        compress
    postrotate
        # just if mysqld is really running
        if [ -e /run/mariadb/mariadb.pid ]
        then
           kill -1 $(</run/mariadb/mariadb.pid)
        fi
    endscript
}

So should I just run logrotate -vf /etc/logrotate.conf? How does the status file work with the actual rotation?

Depending on how urgently you need to rotate log files, I must defer to your judgement about whether to run logrotate now or wait.

My preference would be, if disk space is not a problem, to establish automatic runs of logrotate – with the objective of confirming an automatic run within the next 24 hours.

If you need to run logrotate immediately, you can – however this will delay your efforts to diagnose the automatic run of logrotate by one day – because if you run it manually now, logrotate will not complete a meaningful run for more than 24 hours later.

Is the cron service operational? To check status: systemctl status crond.service. To confirm activity: journalctl | grep crond

Is logrotate specified in a cron spec? There are many cron spec files to check (as described by cron (8)). If none specify logrotate, you can place a logrotate script in the /etc/cron.daily (since daily seems to be the most frequent run for you present logrotate config).

An example logrotate script:

#!/bin/sh
/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

An by the way, a possible explanation for the MySQL cruft in logrotate.status. “rpm -ql logrotate” indicates that the logrotate.status file is part of the logrotate package. So the cruft probably arrived courtesy of the recent dnf. Had you waiting more than four weeks to look at it, that bit of nonsense would have probably rotated out – unnoticed and not a concern.

Yes it’s running fine all other crons run:

systemctl status crond.service
● crond.service - Command Scheduler
   Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-12-25 10:11:58 EST; 2 weeks 6 days ago
 Main PID: 2354 (crond)
    Tasks: 4 (limit: 154017)
   Memory: 724.7M
      CPU: 17min 33.386s
   CGroup: /system.slice/crond.service
           ├─   2354 /usr/sbin/crond -n
           ├─3806122 /usr/sbin/CROND -n
           ├─3806123 /usr/bin/bash /usr/share/clamav/freshclam-sleep
           └─3806125 sleep 7328

Jan 14 14:02:16 storm freshclam[3797882]: main.cld is up to date (version: 59, sigs: 4564902, f-level: 60, builder: sigmgr)
Jan 14 14:02:16 storm freshclam[3797882]: daily.cld is up to date (version: 25695, sigs: 2134453, f-level: 63, builder: raynman)
Jan 14 14:02:16 storm freshclam[3797882]: bytecode.cvd is up to date (version: 331, sigs: 94, f-level: 63, builder: anvilleg)
Jan 14 14:02:17 storm freshclam[3797882]: Database updated (6726420 signatures) from database.clamav.net
Jan 14 15:00:01 storm CROND[3806123]: (root) CMD (/usr/share/clamav/freshclam-sleep)
Jan 14 15:01:01 storm CROND[3806293]: (root) CMD (run-parts /etc/cron.hourly)
Jan 14 15:01:01 storm run-parts[3806296]: (/etc/cron.hourly) starting 0anacron
Jan 14 15:01:01 storm run-parts[3806302]: (/etc/cron.hourly) finished 0anacron
Jan 14 16:01:01 storm CROND[3813665]: (root) CMD (run-parts /etc/cron.hourly)
Jan 14 16:01:01 storm run-parts[3813668]: (/etc/cron.hourly) starting 0anacron

And:

journalctl | grep cron
Jan 14 08:01:01 storm CROND[3738739]: (root) CMD (run-parts /etc/cron.hourly)
Jan 14 08:01:01 storm run-parts[3738742]: (/etc/cron.hourly) starting 0anacron
Jan 14 08:01:01 storm run-parts[3738748]: (/etc/cron.hourly) finished 0anacron
Jan 14 09:01:01 storm CROND[3748233]: (root) CMD (run-parts /etc/cron.hourly)
Jan 14 09:01:01 storm run-parts[3748236]: (/etc/cron.hourly) starting 0anacron
Jan 14 09:01:01 storm run-parts[3748242]: (/etc/cron.hourly) finished 0anacron

Yes I see it, the last entry.

Why would I need this? On all of our other Fedora systems the log rotation works fine so it must already be there. I see /usr/lib/systemd/system/logrotate.timer which has:

[Unit]
Description=Daily rotation of log files
Documentation=man:logrotate(8) man:logrotate.conf(5)

[Timer]
OnCalendar=daily
AccuracySec=1h
Persistent=true

[Install]
WantedBy=timers.target

So would that be the script that runs daily? It was disabled:

systemctl status logrotate.timer
● logrotate.timer - Daily rotation of log files
   Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; disabled; vendor preset: disabled)
   Active: inactive (dead)
  Trigger: n/a
     Docs: man:logrotate(8)
           man:logrotate.conf(5)

so I enabled/started. Guess I’ll have to wait a day or so?

2 Likes

Excellent. Thank you for the introduction to logrotate.timer. So according to system.time (7), “daily” translates to 00:00:00 (local TZ), and with AccuracySec=1h, logrotate should run daily between 00:00:00 and 01:00:00.

Err … systemd.time (7)

Your can edit your own post (24 hrs):

1 Like

Thanks everyone, the logs have rotated!

I’m still wondering how those MySQL entries got into the status file…/

:flying_saucer: Citizen!
:cat2: Please, enjoy this beautiful cat, while our friendly crew of moderators get this topic erased.
:tulip:

say what now??? Erased?

Not every body solved the log rotation issue yet. Be patient!

@vits95: may I request you to please refrain from such off topic comments? They make the topic harder to follow—they are irrelevant, and therefore are just noise. Please only post if you have something related to the query.