Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • logrotate with option dateext adds timestamp of tommorrow to a file rotated today

    Posted on

    Hello,

    Today I have a question regarding logrotate with the option dateext (see logrotate(8)). The following example should illustrate the scenario I found on one of my hosts:

    -rw-------. 1 root    root       4302 Mar  9 06:00 maillog
    -rw-------. 1 root    root       5011 Feb 10 06:00 maillog-20180211
    -rw-------. 1 root    root       5723 Feb 18 06:00 maillog-20180219
    -rw-------. 1 root    root       4296 Feb 24 06:00 maillog-20180225
    -rw-------. 1 root    root       6068 Mar  3 06:00 maillog-20180304
    -rw-------. 1 root    root     443818 Mar  9 13:14 messages
    -rw-------. 1 root    root     582574 Feb 11 03:45 messages-20180211
    -rw-------. 1 root    root     672321 Feb 19 03:24 messages-20180219
    -rw-------. 1 root    root     491993 Feb 25 03:07 messages-20180225
    -rw-------. 1 root    root    1255279 Mar  4 03:39 messages-20180304
    

    As you can see a string with a timestamp is attached to the rotated logfiles. And in case of the messages log the dateext string it the expected from the day the log was rotated.

    But in case of the maillog dateext adds a string were the timestamp is from one day in the future. My question: "Why that?"

    The above is only an example. I have some more logs where the timestamp is from the future. Do someone know how this happens?

    My /etc/logrotate.conf looks like:

    weekly
    rotate 4
    create
    dateext
    include /etc/logrotate.d
    

    Best regards,
    Joerg K.

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat