:: krowemoh

Thursday | 26 DEC 2024
Posts Links Other About Now

previous
next

Logrotate Cheatsheet

2022-09-24
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