You are not logged in.

#1 2008-01-23 19:40:32

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,926
Website

/var/log.... is eating my /

Ok /var/logs is filling up at an alarming rate... need to sort it out

[off to check wiki]

9.3g is waay too much!!!!

Help!


Mr Green

Offline

#2 2008-01-23 20:02:07

ploub
Member
Registered: 2007-05-16
Posts: 135

Re: /var/log.... is eating my /

logrotate?

Offline

#3 2008-01-23 20:04:34

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,926
Website

Re: /var/log.... is eating my /

emmm yes..../me searches thanks ;-)


Mr Green

Offline

#4 2008-01-23 20:09:20

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,926
Website

Re: /var/log.... is eating my /

May need some help to set it up... got logrotate installed .....


Mr Green

Offline

#5 2008-01-23 21:17:19

ploub
Member
Registered: 2007-05-16
Posts: 135

Re: /var/log.... is eating my /

Offline

#6 2008-01-24 01:23:48

ProzacR
Member
Registered: 2007-04-29
Posts: 272

Re: /var/log.... is eating my /

And similar question. It is normal just to do:
cd /var/logs
rm -r *
? Or it is bad idea?

Offline

#7 2008-01-24 07:20:19

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: /var/log.... is eating my /

Are you starting the crond daemon? And is you computer powered when it's running? If your computer is shut down most of the time, you might want to try anacron in community.

ProzacR: I guess you could  but using logrotate is better as you don't lost the recent information that has been added to the logs.

Offline

#8 2008-01-24 11:06:47

sniffles
Member
Registered: 2008-01-23
Posts: 275

Re: /var/log.... is eating my /

ProzacR wrote:

And similar question. It is normal just to do:
cd /var/logs
rm -r *
? Or it is bad idea?

Bad idea.

Offline

#9 2008-01-24 12:25:27

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: /var/log.... is eating my /

If you've got a large log, check what's causing the size. If it's nothing important, you're fine to remove it, though it might be a good idea to create an empty file in it's place. I wiped out a few the other day, didnt hurt.

Offline

#10 2008-01-24 13:34:11

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: /var/log.... is eating my /

# rm /var/log/*.{old,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}

lol

Last edited by schivmeister (2008-01-24 13:35:23)


I need real, proper pen and paper for this.

Offline

#11 2008-01-24 14:04:15

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: /var/log.... is eating my /

schivmeister wrote:
# rm /var/log/*.{old,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}

lol

1) logrotate must be working to get *.log.X.gz (if compression enabled), or *.log.X
2) usually logrotate puts these in /var/log/archive (unless something else specified)
so you will not have anything in /var/log/*.log.X
3) if logrotate is not configured only working log file is present (and growing without any limit imposed)

you can run logrotate at any time manually.
1) configure /etc/logrotate.conf
- uncomment
olddir /var/log/archive

make sure that /var/log/archive is created

- uncomment
compress

save run (root privileges)
/usr/sbin/logrotate -f /etc/logrotate.conf

now configure cron to run the above (configure periodic log rotation in logrotate.conf)

do not try to rm .log files, mess up syslog, some are in use, this is really brutal method.

Offline

#12 2008-01-24 14:35:56

schivmeister
Developer/TU
From: Singapore
Registered: 2007-05-17
Posts: 971
Website

Re: /var/log.... is eating my /

in use? *.x are at least a month old on my system, hah! pacman.log itself goes back 05/03/07 big_smile


I need real, proper pen and paper for this.

Offline

#13 2008-01-24 18:56:24

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,926
Website

Re: /var/log.... is eating my /

Ok so I need to create a config file

/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}

As an example... I need one to rotate kernel everything and errors ? crond is set in rc.conf so....more run it every week...


Mr Green

Offline

#14 2008-01-24 19:09:48

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: /var/log.... is eating my /

if you leave default settings for log rotation logrotate will archive:
access.log
auth.log
daemon.log
errors.log
everything.log
iptables.log
kernel.log
messages.log
user.log
and whatever daemon will use logs.

no need to add Xorg.0.log or logfiles that behave similarly.

Offline

#15 2008-01-24 19:31:37

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,926
Website

Re: /var/log.... is eating my /

in logrotate.d I have

 more syslog-ng
/var/log/messages.log /var/log/auth.log /var/log/mail.log /var/log/kernel.log /v
ar/log/errors.log /var/log/daemon.log /var/log/user.log /var/log/iptables.log /v
ar/log/everything.log /var/log/syslog.log /var/log/acpid.log {
    missingok
    sharedscripts
    postrotate
        /bin/kill -HUP `cat /var/run/syslog-ng.pid 2>/dev/null`  2> /dev
/null || true
    endscript

I figure I must do some more reading up...


Mr Green

Offline

Board footer

Powered by FluxBB