LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2006, 07:56 AM   #1
onmountain
LQ Newbie
 
Registered: Oct 2005
Distribution: Debian
Posts: 16

Rep: Reputation: 0
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!
 
Old 02-03-2006, 03:00 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
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.
 
Old 07-31-2008, 02:27 AM   #3
sloganyart
LQ Newbie
 
Registered: Jan 2007
Location: Johor, Malaysia
Distribution: Slackware 9.2,12.2,13.0, Debian woody,sarge,etch,Centos5.3
Posts: 22

Rep: Reputation: 15
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Webalizer With Log Rotation dmedici Linux - Software 0 08-17-2004 09:06 AM
manual log rotation will103 Linux - Newbie 2 04-20-2004 02:20 AM
disable log rotation in site krishn Linux - General 1 07-28-2003 07:53 AM
Log rotation - NewB nrastogi Linux - Software 1 02-12-2003 10:44 PM
Syslog Daemon log capturing ascii2k Linux - Networking 1 10-08-2001 01:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration