[lug] Cleaning up /var when it gets too full

Chip Atkinson chip at rmpg.org
Mon Sep 16 09:16:40 MDT 2002

What I do is
su -
cd /var
du -k | sort -n > dustats
Then I look at dustats and decide what to get rid of.  If you don't care
about keeping them, the log files get pretty big.  You can also modify
logrotate's files to keep fewer logs.  This may be a security risk though
because of losing intrusion information.
The spots that fill up for me are /var/log and /var/spool/mail/


On Mon, 16 Sep 2002, bof wrote:

> Hello,
> How does one go about cleaning their /var partition when it gets full?
> When I set up KRUD 7.3, I allocated a partition size of 125 MB for /var.
> Now it has some 117 MB in it, so it is almost 100% used, and I can't
> print anything because CUPS can't get enough space in the spooler for
> its print jobs. Surely I don't need all the stuff on /var, since it
> wasn't on the system when I set it up initially  --- I thought /var was
> for a temporary holding area, so no files on it would be permanently
> needed and could be deleted as necessary. But I am not sure what I can
> and cannot delete to clear up space on it. I've looked at the file
> listings, and it's lots of little files and directories, no one of which
> is too big by itself, and many which are empty, but all of which add up
> when taken together.
> The top level listing of /var is:
> analog-5.24
> cache
> db
> empty
> lib
> local
> lock
> log
> lost+found
> mail
> nis
> omninames
> opt
> preserve
> run
> spool
> tmp
> www
> yp
> So what can I keep and what can I delete, and what would be the best way
> to go about doing this --- is there a way of setting a cron job to
> delete uneeded files?
> Thanx.
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug

More information about the LUG mailing list