Tekforums

Chat => Entertainment & Technology => Topic started by: maximusotter on April 26, 2006, 19:05:36 PM

Title: Beware excessive /var usage in Ubuntu
Post by: maximusotter on April 26, 2006, 19:05:36 PM
Mine was over 2.5g in size. About half each in apt-cache and the other in /var/log/*, just /var/log/messages was near half a gig. :lol:

You can turn off apt-caching in Synaptic, and for the system log files, I just open an editor and a file manager as root and save blank files in the name of the big log files I dont want any more. There must be a way to do the automatically, Im just too lazy to find out. :P
Title: Beware excessive /var usage in Ubuntu
Post by: cornet on April 26, 2006, 23:48:02 PM
The following cron scripts should take care of the log files:

/etc/cron.daily/sysklogd
/etc/cron.weekly/sysklogd


Although I would generally get rid of the weekly one and in the daily change:

for LOG in `syslogd-listfiles`

to

for LOG in `syslogd-listfiles -a`


So it rotates all files on a daily basis.
Also in the same files the line:

savelog -g adm -m 640 -u root -c 7 $LOG >/dev/null

Tells it to keep 7 days worth - change the 7 to something lower if you want (not 0 thou - that may well keep everything).

As for the apt cache then I do

apt-get clean

which gets rid of old downloaded files.

You could set up a weekly cron job to do run it :)

Cornet