Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    The rotation will happen when logrotate runs, and that's probably once a day or so by default in most distros. You might want to try something like github.com/jbaublitz/logrustate (based on Google results for a logrotate that can "watch" for things, never tried it myself) Commented Dec 5, 2022 at 11:37
  • Please edit your question and add more details. What exactly means "it doesn't work as I expect"? You wrote what you expect, but not what actually happens. Does it rotate the logfile at all? What size do the rotated files have? At what date/time did the rotation take place? Commented Dec 5, 2022 at 11:54
  • please provide your OS release info as well Commented Dec 5, 2022 at 12:02
  • 2
    logrotate is not a daemon that runs in the background and is able to react when the file grows. It's a program run from cron, anacron or systemd, usually once a day. To see if your config works, you need to wait until logrotate runs; or you need to start it manually, it will do its job and will exit. Commented Dec 5, 2022 at 12:11