LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-02-2005, 08:35 AM   #1
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 50
limit and delete log files


hi

I have enabled syslog on my mail appliance.

Now I get on my Debian Sarge Stable in:

/var/log/appliance/messages

a very big logfile.

howto limit these log files to 500k and howto configure to delete daily ?

greetings
cccc

Last edited by cccc; 07-02-2005 at 09:41 AM.
 
Old 07-02-2005, 10:01 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
you need to look into your logrotate configuration. see the logrotate manpage for details on how to use it.
 
Old 07-02-2005, 10:10 AM   #3
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 50
Yes, of course I looked there.

I've created in /etc/logrotate.conf following entries:
Code:
/var/log/appliance/messages /var/log/appliance/error.log {
           daily
           size=500k
           create 0664 root utmp
           rotate 1
       }
but it doesn't work.

greetings
cccc
 
Old 07-02-2005, 11:19 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
of course? if it's "of course" then "of course" you should have already said so.

So does this logrotate config work? force it's run directly using "logrotate -f /etc/logrotate.conf"
 
Old 07-02-2005, 11:47 AM   #5
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 50
Code:
# logrotate -f /etc/logrotate.conf
Reload syslog service                                                done
Shutting down snmpd:                                                 done
Starting snmpd                                                       done
stat of /var/log/appliance/error.log failed: No such file or directory
should I create error.log file manually ?
 
Old 07-02-2005, 11:56 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
it wouldn't hurt to just touch it no...
 
Old 07-05-2005, 05:06 PM   #7
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 50
it seems not to work !

greetings
cccc
 
Old 07-05-2005, 05:12 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
what doesn't work?? what errors do you get?? what actually does happen??
 
Old 07-05-2005, 05:22 PM   #9
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 50
the correct way is to create a file in /etc/logrotate.d

I think logrotate cannot limit the size, but logrotate runs daily and new file will be created each time.

greetings
cccc

Last edited by cccc; 07-15-2005 at 06:47 PM.
 
Old 07-15-2005, 06:47 PM   #10
cccc
Senior Member
 
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Original Poster
Rep: Reputation: 50
maybe someone has a perl script to check from cron and limit the size of the logfiles ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to delete files that won't delete? di11rod Linux - Security 7 10-19-2005 09:14 PM
howto network syslog with multiple log files mcalizo Red Hat 2 05-27-2005 06:58 AM
Syslog server can't open log files >500mb mikeyt_333 Linux - General 2 01-11-2005 11:32 AM
how can I do to delete these files? tuzhiyong Linux - Software 2 12-02-2004 11:01 AM
How to delete the destination files while the source files deleted in cp -u ? myunicom Linux - General 4 09-26-2003 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration