Monday | 15 APR 2024
[ previous ]
[ next ]

Logrotate Cheatsheet

Title:
Date: 2022-09-24
Tags:  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