The 'time based'(hourly, daily, weekly, monthly) and 'size' baesd execution frequencies are available in the logrotate.. Logrotate is configurated to run daily default. There is no option to run logrotate like every 5 minutes, 30 minutes. We can configure logrotate to like every 5 minutes, 30 minutes using manualy crontab entry.
/var/log/syslog
{
rotate 3
maxsize 5M
missingok
notifempty
delaycompress
compress
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
{
rotate 3
maxsize 2M
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
You can configure the normal crontab settings here.
sudo touch /var/lib/logrotate/customizedlogrotatestatus
sudo crontab -e
*/5 * * * * /usr/sbin/logrotate /etc/logrotate.conf --state /var/lib/logrotate/customizedlogrotatestatus
sudo crontab -e
0 * * * * /usr/sbin/logrotate /etc/logrotate.conf --state /var/lib/logrotate/customizedlogrotatestatus