Logrotate of /var/log/boot.log throws error about missing /var/log/boot.log.tmp

Solution Verified - Updated -

Issue

The snippet /etc/logrotate.d/bootlog causes error message:

rotating pattern: /var/log/boot.log
 forced from command line (7 rotations)
olddir is /var/log/old, empty log files are not rotated, old logs are removed
considering log /var/log/boot.log
  Now: 2021-02-17 16:03
  Last rotated at 2021-02-16 15:55
  log needs rotating
rotating log /var/log/boot.log, log->rotateCount is 7
dateext suffix '-20210217'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
set default create context to system_u:object_r:plymouthd_var_log_t:s0
copying /var/log/boot.log.tmp to /var/log/old/boot.log-20210217
error: error opening /var/log/boot.log.tmp: No such file or directory
removing tmp log /var/log/boot.log.tmp
set default create context to system_u:object_r:logrotate_var_lib_t:s0

Environment

Red Hat Enterprise Linux

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