Linux

Where Does Logrotate Store Config and State?

Logrotate reads /etc/logrotate.conf plus every file in /etc/logrotate.d. Packages drop their own rules there.

Last updated

Logrotate pairs one main config with a drop-in folder. Packages ship rotation rules into logrotate.d, the main file sets defaults like weekly and rotate counts.

Custom logs need one small file, not main config edits. Drop it in, dry-run it, walk away. State in /var/lib tracks last runs so schedules hold across reboots.

Where Logrotate stores this, by platform

Linux
/etc/logrotate.conf + /etc/logrotate.d/

Main defaults plus per-package rule files. Add custom rules as new files here, never edit shipped ones.

Frequently asked questions

How do I rotate a custom app log?

Add a file in /etc/logrotate.d with the path and schedule. Test with logrotate -d for debug or --force for a real run. No daemon restart needed.

Where is the rotation state?

Status lives in /var/lib/logrotate/status. It records last rotation per file. Delete a line to force that log to rotate next run.

What actually runs logrotate?

Cron or a systemd timer runs it daily. Check which owns it on your distro. Rules do nothing until that trigger fires.

Notice an outdated path? Let us know.