Skip to content

Instantly share code, notes, and snippets.

@cemeyer
Last active October 22, 2023 12:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemeyer/d4a10052d7bbb8a96977eaeeb066fd56 to your computer and use it in GitHub Desktop.
Save cemeyer/d4a10052d7bbb8a96977eaeeb066fd56 to your computer and use it in GitHub Desktop.
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