Skip to content

Instantly share code, notes, and snippets.

@rrei
Last active December 23, 2023 10:00
Show Gist options
  • Save rrei/bac8aec1637a26079604b6de9710b1bf to your computer and use it in GitHub Desktop.
Save rrei/bac8aec1637a26079604b6de9710b1bf to your computer and use it in GitHub Desktop.
/path/to/logs/*.log {
# Effective uid/gid used when running this pattern
# NOTE: this **is not** the same as the owner user and group of the rotated files
su root root
# Rotate once every day
daily
# Keep a history of 5 rotations
rotate 5
# Rotate even if the log file is empty
ifempty
# Skip this block without error if no files match the pattern
missingok
# Copy and truncate the original log file
copytruncate
# Compress rotated logs
compress
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment