Skip to content

Support locking / prevent concurrent compress jobs of the same log file #295

@raoulbhatia

Description

@raoulbhatia

Hi,

I am encountering duplicate runs of gzip related to big log files that need rotating when calling logrotate i.e. hourly.

My use case:

  • I am receiving 100-500GB of logs via rsyslog (daily) that I save to a local logfile.
  • To ensure that logs are rotated in i.e. sizeable junks, I run logrotate hourly.
  • To save on disk space, i enabled delaycompress.
  • When the system is under load (CPU and/or IO), compression might take >1hr. Thus, logrotate is started again and ends up delaycompress-ing the same file again, contributing to the overload of the system. In this way, I sometimes see 4-5 concurrent instances of logrotate & gzip.

Is there a way to handle this (w/o implementing a locking mechanism myself), or would this require new functionality in logrotate?

Thanks,
Raoul

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions