On Sun, 22 Mar 2009 19:05:40 David C. Rankin wrote:
David C. Rankin wrote:
I went ahead a created a script to check log file size that you can add to the root cron tab to run once daily. I called the script cklogsize, and a cron entry to run it at 10 minutes after 4 am each day would be:
10 4 * * * /home/david/linux/scripts/log/cklogsize zypp-refresh.log
The script and explanation follows. To make sure you don't have any line wrap problems, you can also download a copy here:
<snip>
Looks like there is also a much easier way than rolling a custom script and crontab. Just edit /etc/logrotate.d/zypper.lr and add a section for /var/log/zypp-refresh.log. I just copied the entry for /var/log/zypper.log. When you are done, the file should look like:
/var/log/zypper.log { compress dateext notifempty missingok nocreate
maxage 60 rotate 99 size 10M }
/var/log/zypp-refresh.log { compress dateext notifempty missingok nocreate
maxage 60 rotate 99 size 10M }
Oh well, a fun hour spent on the script itself. Cheers.
Thanks for the heads-up, David. I just checked mine (haven't visited /var/log much recently) and found 573M, so I added the section to the logrotate on my machines too... I think this might be worth a bugzilla - this should be in there by default and I can't see anyone objecting to it being there. It is such an easy fix for them to roll out, too... Cheers, Rodney. -- =================================================== Rodney Baker VK5ZTV rodney.baker@iinet.net.au ===================================================