Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sane logrotate.conf settings
# create new (empty) log files after rotating old ones
create
# use date as a suffix of the rotated file
dateext
compress
compresscmd /bin/zstd
compressext .zst
compressoptions -18 -T0 --rm
uncompresscmd /bin/unzstd
rotate 30
nodelaycompress
nomail
notifempty
size 10M
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
...
# I'd also suggest adding logrotate to /etc/cron.hourly in addition to cron.daily, because
# why the hell should you wait 23H if your log is oversized?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment