LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to change Debian log rotation of syslog and daemon.log (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-debian-log-rotation-of-syslog-and-daemon-log-410361/)

onmountain 02-01-2006 07:56 AM

How to change Debian log rotation of syslog and daemon.log
 
Hi. I am using webalizer to generate these terrific charts of webpage hits, etc, but I need to make a change to the number of days my log files are being rotated.

Right now, syslog and daemon.log are both rotated each day for 7 days. So I end up with a syslog, syslog.0, syslog.1, ... syslog.6

My server has tons of room, and I want to change it so that I rotate these log files everyday but keeps a whole year of them. An alternative would be to rotate these logs weekly and keep 52 weeks.

I can see how my Shorewall and other software is configured for thier log files, using /etc/logrotate.d and the daily cron system. However, I can't figure out how syslog and daemon.log are configured and rotated.

Any ideas? Thanks!

bulliver 02-03-2006 03:00 PM

logrotate.conf usually has generic rotate configuration whereas logrotate.d is a place for individual servers/apps to put their info...so have a look in logrotate.conf.

You will want to change "rotate" from whatever figure it is to "rotate 52" if you really want a years worth. Keep your eye on disk usage as a years worth is a huge amount of logs.

sloganyart 07-31-2008 02:27 AM

Debian syslog rotation is not controlled by logrotate at all, please don't mislead the OP when you're not sure with it. You might making him going to the wrong direction in solving this and waste a lot of his time.

Debian syslog rotation is controlled by cron daily script which sit in /etc/cron.daily/sysklogd , and this script will run everyday morning depends on how your /etc/crontab define it.

And in the file /etc/cron.daily/sysklogd, you could clearly notice the rotation is done by the command 'savelog'. In default it put a cycle of 7, which will make you having syslog.0 till syslog.6

In your case, you might want to change both the /etc/cron.daily/sysklogd and /etc/cron.weekly/sysklogd , to suit to your needs. Please be aware that the mentioned script is using a command 'syslogd-listfiles' to indeed decide what log file to be handled.

What I suggest is you modify how 'syslogd-listfiles' is called in those script and as well as the 'savelog' '-c' option.


All times are GMT -5. The time now is 02:34 PM.