Tuesday | 16 DEC 2025

next

2022-09-24
Logrotate Cheatsheet

cheatsheet

/etc/logrotate.d/sample-log

/path/to/logs/*.txt {
    nocompress
    copytruncate
    dateext
    rotate 15
    size 250K
}

This will run on a cron. To manually run it you can do:

logrotate /etc/logrotate.d/sample-log

More information:

https://nivethan.dev/devlog/logrotate.html