0

Please kindly advise/assist. I want to set up logrotate that does the following: when the log file size reaches 10M,the file is rotated and also there is no keeping of older compressed log files. I have tried the following and its not working :

log_file_path {
    size 10M
    delaycompress
    copytruncate
    missingok
    notifempty
}
Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
sawe
  • 11
  • 3
  • 5

1 Answers1

1

You need to configure running logrotate in such intervals that the size of your log file has exceeded 10 megabytes.

For example, if your log file gets 10M of data in ten minutes, then you need to run logrotate every 10 minutes.

This won't make the rotated log files exactly ten megabytes in size.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63