3

I'm working with logrotate in Centos 6.4 and wanted to rotate the logs daily or when they reach 50MB.

The only problem i'm facing is that the version of logrotate for CentOS is 3.7.8, which does not have the maxsize option i need to use.

Is there any workaround for this? The options in this logrotate 3.7.8 aren't enough unless i make a cron that runs every minute to check file sizes...

Thanks in advance.

noidraug
  • 219
  • 1
  • 9

1 Answers1

0

I think, you still can use size option.

Example:-

size 100k

This means whenever the size grows over 100K the rotation is started.

Akshay Patil
  • 954
  • 1
  • 12
  • 28
  • 1
    I use size, but it only checks it when logrotate is ran, which is only once a day because of cron. I didn't want to put logrotate being executed every minute or so to have a fresh check... Looks like i'll have to find some other way. Thanks anyway – noidraug Feb 14 '14 at 09:25
  • 2
    If logrotate is not run, how else would you know that the files have gotten beyond the size threshold? You just have to schedule logrotate to run more often than once a day. – hookenz May 19 '14 at 01:28