I have implemented Log rotation as :-
/data/mule/logs/*.log {
rotate 1
size 20M
missingok
noolddir
nomail
notifempty
create 644 root root
compress
}
But the logs are not getting rotated continuously if the size increases beyond limit. It rotates only once in a day.
Can anyone help me to continuously check the logs in the path and if it exceeds the limit of 20mb it should be rotated.
I have configured in the crontab to run every 5 minutes. However I am getting below error while running it :
/etc/logrotate.d/mule: line 1: /data/mule/logs/app.zip.log: Text file busy
/etc/logrotate.d/mule: line 2: rotate: command not found
/etc/logrotate.d/mule: line 3: minsize: command not found
/etc/logrotate.d/mule: line 4: missingok: command not found
/etc/logrotate.d/mule: line 5: noolddir: command not found
/etc/logrotate.d/mule: line 6: nomail: command not found
/etc/logrotate.d/mule: line 7: notifempty: command not found
/etc/logrotate.d/mule: line 8: create: command not found
/etc/logrotate.d/mule: line 9: compress: command not found
/etc/logrotate.d/mule: line 10: syntax error near unexpected token `}'
/etc/logrotate.d/mule: line 10: `}'
I have added the below in my crontab :-
*/5 * * * * /etc/logrotate.d/mule