[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Files piling up in /var/* directories



Charles wrote:
I've noticed that I have files piling up in /var/cache, /var/log, and
 /var/lib.  These three folders now have 100 mb of files in them.


Which of these must be present for the machine to run?  This is (at
the moment) a home machine; I don't *need* the  log files, but I
don't know what happens if I just delete the files in these three
directories.

If you install the packages "logrotate" and "cron" the log files will be
dealt with in a reasonable manner automatically. This means that older
logs are saved in a compressed format and deleted after seven days. This
"rotation" happens every night. If you do not leave your computer on
over night then you need the package "anacron" which makes sure that all
skipped nightly cron jobs are run at the next best opportunity. (Five
minutes after boot by default, but this can be changed in a config file.)

I would suspect that the main contributor to your /var/cache are the old
versions of all Debian packages that you ever installed. These reside in
/var/cache/apt/archives/. aptitude will clean up this directory for you
if you issue on of the following commands as root:

aptitude autoclean
aptitude clean

The first command removes all obsolete packages from the cache; the
second one is more aggressive and empties the cache completely. If you
do not use aptitude you can achieve the same results with "apt-get
autoclean" and "apt-get clean".

I would leave /var/lib alone. It holds libraries and configuration data
for various applications, as far as I know.

Regards,
            Florian



Reply to: