Skip to content

Maxage doesn't delete old logs without using dateext #301

@swoopdk

Description

@swoopdk

I seem to have run into an issue.
When using something like this example the maxage option doesn't delete the older logfiles (regardless of how old the mtime on them are) unless we also use the dateext option.

Shouldn't it be working regardless if dateext is being used or not ?

I should note i'm using the rotate -1 option to only have older files be deleted on age and irregardless of number of logs.

Example of rotate.conf that does not seem to remove older logs ever.

/home/swoopdk/logtest/logs/*.log {
  daily
  rotate -1
  ifempty
  maxage 2
}

However this one seems to work from my initial testing.

/home/swoopdk/logtest/logs/*.log {
  dateext
  daily
  rotate -1
  ifempty
  maxage 2
}

I have not looked into the code yet and might be fixed in upcomming releaese this friday, but from what i gather its a bug. Unless i'm misreading the documentation and the rotate -1 doesn't do what i think it does.

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