LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-06-2008, 02:24 PM   #1
Ronin_tekorei
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 57

Rep: Reputation: 15
logrotate


Hello again,
I have a problem with the logs on the server of my work, the log semm to be just keep going, the logrotate have no effect on it.
2 moutns now and it just don't rotate.
ls -l of the /var/log is this
Code:
-rw-r-----  1 root  root      2871 Jan 26  2003 acpid
-rwxr-xr-x  1 root  root     19925 Jan  4  2003 anaconda.log
-rwxr-xr-x  1 root  root     43907 Jan  4  2003 anaconda.syslog
-rw-------  1 root  root    129072 Feb  6 16:06 boot.log
-rw-------  1 root  root      2890 Jan 19  2003 boot.log.1
-rw-------  1 root  root     10303 Jan 12  2003 boot.log.2
-rw-------  1 root  root      8134 Jan  5  2003 boot.log.3
-rw-------  1 root  root    330494 Feb  6 16:44 cron
-rw-------  1 root  root    337529 Jan 19  2003 cron.1
-rw-------  1 root  root    337811 Jan 12  2003 cron.2
-rw-------  1 root  root     53242 Jan  5  2003 cron.3
drwxr-xr-x  2 lp    sys       4096 Jan 19  2003 cups
-rw-r--r--  1 root  root     10668 Feb  6 14:09 dmesg
drwx------  2 root  root      4096 Oct 15  2004 httpd
drwx------  2 root  root      4096 Jul 31  2003 iptraf
-r--------  1 root  root  19136220 Feb  6 14:14 lastlog
drwxr-xr-x  2 root  root      4096 Jan  4  2003 mail
-rw-------  1 root  root      8761 Jan 26  2003 maillog
-rw-------  1 root  root      8359 Jan 19  2003 maillog.1
-rw-------  1 root  root     10454 Jan 12  2003 maillog.2
-rw-------  1 root  root      3160 Jan  5  2003 maillog.3
-rw-------  1 root  root  17164698 Feb  6 16:58 messages
-rw-------  1 root  root    558666 Jan 19  2003 messages.1
-rw-------  1 root  root    620166 Jan 12  2003 messages.2
-rw-------  1 root  root    143473 Jan  5  2003 messages.3
drwx------  2 root  root      4096 Nov  2  2004 ppp
-rw-r--r--  1 root  root     12958 Jan 25  2003 prelink.log
-rw-r--r--  1 root  root      3365 Jan  4  2003 prometheus
-rw-r--r--  1 root  root     10813 Jan 25  2003 rpmpkgs
-rw-r--r--  1 root  root     10813 Jan 18  2003 rpmpkgs.1
-rw-r--r--  1 root  root     10813 Jan 11  2003 rpmpkgs.2
-rw-r--r--  1 root  root     10813 Jan  4  2003 rpmpkgs.3
drwx------  2 root  root      4096 Oct 19  2004 samba
-rw-------  1 root  root   5400367 Feb  6 14:30 secure
-rw-------  1 root  root       248 Jan 18  2003 secure.1
-rw-------  1 root  root       992 Jan 11  2003 secure.2
-rw-------  1 root  root       672 Jan  4  2003 secure.3
-rw-------  1 root  root         0 Jan 19  2003 spooler
-rw-------  1 root  root         0 Jan 12  2003 spooler.1
-rw-------  1 root  root         0 Jan  5  2003 spooler.2
-rw-------  1 root  root         0 Jan  4  2003 spooler.3
drwxr-x---  2 squid squid     4096 Aug  3  2003 squid
drwxr-xr-x  2 root  root      4096 Oct  5  2004 vbox
-rw-rw-r--  1 root  utmp   1546368 Feb  6 14:14 wtmp
-rwxr-xr-x  1 root  root       265 Aug  1  2003 yum.log
as you can see, messeges and secure logs are just going and going with the zise.
my logrotate.conf
Code:
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}

# system-specific logs may be also be configured here.
i need the log to restart rotating, if posible every 2 weeks, and just keep 4 backlogs for 4 weeks and the erase the older one.
Is it posible?
Thanks in advance
 
Old 02-06-2008, 03:41 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Code:
var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}
Try this:
Code:
var/log/wtmp {
    weekly
    rotate 4
    size=100M
    create 0664 root utmp
}
Change the log size to suit what you expect in one week.

You have the choice rotating logs daily, weekly, or monthly. Semi-monthly (2 weeks) is not an option, unless the config would accept something like 'monthly/2'.

Rotate the logs 4 times before removing or mailing to someone.
 
Old 02-07-2008, 05:44 AM   #3
Ronin_tekorei
Member
 
Registered: May 2006
Distribution: Fedora
Posts: 57

Original Poster
Rep: Reputation: 15
ok, i have change the config, but do i need to restart something? some service? it is automatic?
 
  


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
Why we use logrotate ? shipon_97 Linux - Newbie 4 01-09-2008 09:15 AM
About logrotate satimis *BSD 1 05-27-2007 01:08 PM
logrotate sidra Red Hat 10 08-01-2006 01:05 AM
Logrotate - did I get it right? Swakoo Linux - General 1 06-20-2006 05:14 AM
logrotate Rig24 Linux - Newbie 2 07-11-2003 05:08 AM

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

All times are GMT -5. The time now is 07:13 PM.

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