I use ubuntu 14.04 I try to run logrotate each 10min and remove all logs files bigger then 2MB, I try a lot solution but nothing not work, my logrotate run just 1 per day, I try solution with moved logrotate from cron.daily to cron.hourly but not work, I try other solution and do next:
create file logrotate:
*/10 * * * * root /usr/sbin/logrotate /etc/logrotate.conf
and add in:
/etc/cron.d
this is my /etc/logrotate.d/apache2:
/var/log/apache2/*.log /var/log/apache2/domains/*log {
weekly
missingok
rotate 10
maxsize 2M
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null || true
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \
endscript
}