I have read in several sites that in opensuse it’s possible to clean unused files that remain accumulated in /tmp and /var directories.
I tried this today deleting manually all the content of these dirs as root.
/var had more than 2 GB size and I know many things there were created by cache and remain there after that but are never used again. However after deleting all the cotent of this dir I damaged my system seriously.
I just had no further problem because I had my partition cloned with clonezilla so all I needed was to restore it back again.
But the question is:
In the content of /var directory how can I know what is garbage left by caches and what are important config files so that I can make a responsible cleaning?
Better not clean /tmp (and /var/tmp) when the system is full in use. You can clean /tmp (and /var/tmp) at boot time because all that is in there is then leftovers from the last session.
You can make your system doing this by going into YaST > System > /etc/sysconfig editor and then open +System +Cron. There you will find parameters like CLEAR_TMP_DIRS_AT_BOOTUP and friends. Read what they say and configure. Do not make it to complicated.
The rest of /var (that is besides /var/tmp) is better NOT deleted without further thought. There are very importannt things there.
But take a look at /var/log. If it contains old log files, you can delete them (except when you think you will do something with them in the future). Checking this once a year is usualy enough.
“/var/tmp” has temporary files.
There is a lot that is not temporary elsewhere in “/var”.
If you are tight on disk space, then deleting files whose name ends “.bz2” in “/var/log” should be safe. They are a historical record of old log messages, but nothing running on the system requires them. I’m not sure that there is much elsewhere that could be deleted.
You can configure the system to automatically empty “/tmp” on bootup (check the “/etc/sysconfig” settings in Yast).
On 2011-05-29 20:36, fernando a martin wrote:
> In the content of /var directory how can I know what is garbage left by
> caches and what are important config files so that I can make a
> responsible cleaning?
You can not delete things in /var. Those that should have scripts dedicated
to clean them periodically (/var/tmp, /var/log). Most others are meant as
permanent. You can only delete somethings when you know what they are.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
I use the settings suggested by hcw and I have 495Mb in /var having recently booted the computer.
I have about half of it. But remember that there can be many things in /var. MySQL databases are in /var by default! And with a big database your* /var* can thus be GB of size (I would recommend to reorganise in that case of course, but just an example).
On 2011-05-30 11:06, hcvv wrote:
>
> john_hudson;2346547 Wrote:
>> I use the settings suggested by hcw and I have 495Mb in /var having
>> recently booted the computer.
> I have about half of it. But remember that there can be many things in
> -/var.- MySQL databases are in -/var- by default! And with a big
> database your- /var- can thus be GB of size (I would recommend to
> reorganise in that case of course, but just an example).
Faxes, mail store, rpm databases, rpm caches (for a whole network if
configured!)
I have 12 GiB there.
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)
Thanks. Now i understood the point.