To rotate when the log reaches a give size rather than daily, replace the string daily with the size directive.
Log files are rotated when they grow bigger then size bytes. If
size is followed by M, the size if assumed to be in megabytes.
If the k is used, the size is in kilobytes. So size 100, size
100k, and size 100M are all valid.
So in your case for 2M you would do something along the lines of:
/sbin/killall -HUP syslogd
Edit: unspawn is correct in stating that for the above to work you would need to run logrotate more frequently. Depending on how/frequent you are running and how many messages you are received each day, you could easily rotate through the all 99 archives.
From the man page:
" Normally, logrotate is run as a daily cron job. It will not modify a
log multiple times in one day unless the criterium for that log is
based on the log’s size and logrotate is being run multiple times each
Last edited by irabinovitch; 10-17-2011 at 01:59 PM.