After changing logrotate configuration from "nocompress" to "compress", one of lotated files will disappear

Solution Unverified - Updated -

Issue

  • After changing logrotate configuration from "nocompress" to "compress", one of lotated files will disappear.

    1. A situation which lotates with nocompress

      -rw------- 1 root root     0 Jun  6 xx:xx /var/log/messages
      -rw------- 1 root root 14353 Jun  6 xx:xx /var/log/messages.1
      -rw------- 1 root root    46 Jun  6 xx:xx /var/log/messages.2
      -rw------- 1 root root    60 Jun  6 xx:xx /var/log/messages.3
      
    2. Changing the logrotate configuration from "nocompress" to "compress", and executing logrotate

      # logrotate -f /etc/logrotate.conf
      
    3. Then a current log is compressed but the latest lotated file (i.e. messages.1) disappears

      -rw------- 1 root root  0 Jun  6 xx:xx /var/log/messages
      -rw------- 1 root root 24 Jun  6 xx:xx /var/log/messages.1.gz  <== size 14353 file disappeared
      -rw------- 1 root root 46 Jun  6 xx:xx /var/log/messages.2
      -rw------- 1 root root 60 Jun  6 xx:xx /var/log/messages.3
      

Environment

  • Red Hat Enterprise Linux 5
  • logrotate

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content