Tag Info

New answers tagged

0

logrotatie is fine, problem is the "/etc/init.d/syslog reload". Files change the group owner by syslog. There is no problem on SUSE 10 with syslog-ng version1. My workaround: add line "chgrp news /var/log/mail /var/log/messages" after "/etc/init.d/syslog reload".


0

As mentioned in another answer, the problem is that invoke-rc.d nginx rotate returns an error stating that the rotate action is not supported. The interesting thing is that service nginx rotate works without issues. My guess is that the invoke-rc.d wrapper doesn't support all the actions the actual nginx init script supports. Changing invoke-rc.d nginx ...


0

The problem is that /var/log/* is too wide and so matches previously rotated files and rotates them again. You either need to specify a more explicit list, or a more restricted wildcard pattern, or move old logs into a new dir so they wont be mistaken. I would replace, for example, /var/log/* { ... } by /var/log/*.log /var/log/messages { ... }


1

Please use dateext option. Here is notes from man page for logrotate: dateext Archive old versions of log files adding a date extension like YYYYMMDD instead of simply adding a number. The extension may be configured using the dateformat and dateyesterday options.


1

I've seen this trick used before on a separate blog: Create a config file for logrotate, let us call it httpry.conf /var/log/httpry/*.log { size 2 rotate 84 compress missingok copytruncate } Then from cron (may need to be in root's crontab depending on the permissions and ownership of the log files), a crontab of: 0 */2 * * * ...



Top 50 recent answers are included