0

I'm able to call logrotate /etc/logrotate.conf whenever I see my log file exceed the specified threshold and it rotates just fine. I was under the impression though that whenever a file specified in the logrotate config breached its threshold it would rotate them automatically without me having to run the command.

/var/log/upstart/*server.log {
        size 2500M
        missingok
        rotate 5
        compress
        compress
        notifempty
        nocreate
}

Any ideas?

3

Which files will be rotated is indeed specified in /etc/logrotate.conf. But the command logrotate still needs to be run. It can be run manually, but it is normally configured to be run daily by cron.

While it depends on the distro your using, this command will likely output if it is specified to be run periodically by cron:

find /etc/cron* -type f | xargs fgrep logrotate
  • So if it's a cron.daily, it could take up to 24hr after hitting the threshold to rotate? – KuboMD Nov 20 '18 at 17:42
  • 1
    @KuboMD That is correct. – Kusalananda Nov 20 '18 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.