Logrotate fails with error "lines must begin with a keyword or a filename (possibly in double quotes)" due to missing log file paths in custom configuration

Solution Verified - Updated -

Issue

  • The logrotate service fails to execute, or running logrotate in dry-run/debug mode produces the following error messages:

    error: <filename>:<line> lines must begin with a keyword or a filename   (possibly in double quotes)
    error: found error in file <filename>, skipping
    

Environment

  • Red Hat Enterprise Linux 9
  • 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