You are not logged in.

#1 2008-11-05 22:06:21

lang2
Member
Registered: 2006-02-10
Posts: 386

Huge /var directory.

Hi all,

I was trying to download sth with firefox and it was telling me /tmp was full. So I had a look: my / partition is 19G and it was filled up! It turns out that /var is using 7G~ of space almost entirely by 4 files:

-rw-r----- 1 root log  1.9G 2008-11-04 09:02 /var/log/errors.log
-rw-r----- 1 root log  1.9G 2008-11-05 20:32 /var/log/everything.log
-rw-r----- 1 root log  1.8G 2008-11-05 20:32 /var/log/kernel.log
-rw-r--r-- 1 root root 1.6G 2008-11-05 22:03 /var/log/slim.log

Any idea why? Can I safely remove them?

Offline

#2 2008-11-05 22:11:29

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: Huge /var directory.

lang2 wrote:

Any idea why? Can I safely remove them?

yes you can if you are sure you don't need them anymore. Maybe a good idea to add crond to your daemons which runs logrotate every day by default (if installed of course).

Last edited by pressh (2008-11-05 22:11:47)

Offline

#3 2008-11-05 22:30:22

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Huge /var directory.

It might also be a good idea to find out why errors.log is so big. Yikes.

And yes, logrotate is made to solve exactly this problem (giant logfiles)

Offline

#4 2008-11-06 00:03:33

lang2
Member
Registered: 2006-02-10
Posts: 386

Re: Huge /var directory.

hmmm. From looking briefly at the errors.log, it looks like it's been written to for at least over a full year (might be multiple years). Suppose it was created when Arch was first installed. Also a lot of duplicated lines that happens within a min. But 2G text file is still amazing. Anyways, I'll be brave and remove them.

logrotate requires a bit training sad


Thanks,

Offline

#5 2008-11-06 00:20:39

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Huge /var directory.

logrotate comes with some very sane defaults. You should be able to pretty much just do `pacman -S logrotate` and it will do a satisfactory job smile

Offline

#6 2008-11-06 00:45:28

kjon
Member
From: Temuco, Chile
Registered: 2008-04-16
Posts: 398

Re: Huge /var directory.

unfortunately (but, perhaps it's a feature tongue) logrotate doesn't come with a 'maximum logsize' preset. You can hose your PC by inserting a wrong burned dvd and 'everything.log' will start growing without roof. My two cents here are to set 'size 20M' (or whatever your prefer) into /etc/logrotate.conf and dump unused logs after 4 o 5 rolls.


They say that if you play a Win cd backward you hear satanic messages. That's nothing! 'cause if you play it forwards, it installs windows.

Offline

#7 2008-11-06 02:26:18

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Huge /var directory.

4 or 5? hmm

# rotate log files weekly
weekly
# keep 1 year of backlogs
rotate 52

big_smile:D:D

Last edited by fukawi2 (2008-11-06 02:26:33)

Offline

#8 2008-11-06 13:27:27

skymt
Member
Registered: 2006-11-27
Posts: 443

Re: Huge /var directory.

If you're concerned about space on /var, you'll love this:

compress
compresscmd bzip2
uncompresscmd bunzip2
compressext bz2

Add that to logrotate.conf and your old logs will be bzipped. Remember to install lesspipe for easy viewing. If you're really strapped for space, consider trading tool support for size and upgrade to lzma (from the lzma-utils package).

Offline

#9 2008-11-06 13:45:29

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: Huge /var directory.

That's a nice reminder for me to take a shot at a sane syslog config. I hate everything.log with a passion.


1000

Offline

#10 2008-11-06 15:00:33

JGC
Developer
Registered: 2003-12-03
Posts: 1,664

Re: Huge /var directory.

logrotate is run from cron every night. If you only use your laptop during daytime, cron will never run logrotate and your logs keep filling up.

Offline

#11 2008-11-06 15:07:04

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: Huge /var directory.

JGC wrote:

logrotate is run from cron every night. If you only use your laptop during daytime, cron will never run logrotate and your logs keep filling up.

yes but that is easy to change. I wrote a small thing about crond some time ago for the newsletter if someone wonders howto.

Offline

#12 2008-11-06 15:48:16

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: Huge /var directory.

Online

Board footer

Powered by FluxBB