1752793 Members
5985 Online
108789 Solutions
New Discussion юеВ

Re: Cleaning /var

 
SOLVED
Go to solution
C_V
Frequent Advisor

Cleaning /var

Hey guys in /var what are the logs here that can be trimmed/trancute or delete without making anyone angry and what are the logs that should not be touched?
14 REPLIES 14
Khairy
Esteemed Contributor
Solution

Re: Cleaning /var

hi,

use cleanup utility to trim /var/adm/save patches. It good to start with option 1 as it will allow u to rollback any patches.

# cleanup -c 1

Other than that, try the conventional way,

# du -sk /var/*

rgds

ps: really appreciate if u could assign some points.
Khairy
Esteemed Contributor

Re: Cleaning /var

you could also look for old core files in /var. You could safely remove this.

do the following to look for large files in /var

# find /var -size 100000c -print

Jeeshan
Honored Contributor

Re: Cleaning /var

mostly you can see the /var/adm/syslog folder

trim or backup the existing OLDsyslog.log file and restart the syslog daemon. it will move to OLDsyslog.log and syslog.log file would be starting from scratch.

and also you can trim any other log in that folder.

but before that you can take a backup or zip that particular file.
a warrior never quits
Niceguy_2
Advisor

Re: Cleaning /var

Hi,

You can use this commands to find the 1MB file /var
find /var -size +1000000c -exec ll {} \;

You can check for /var/adm/crash and remove the crash file if generated
C_V
Frequent Advisor

Re: Cleaning /var

Tnx guys, how about the /var/spool what is use of this directory, does it contain critical files.
Dennis Handly
Acclaimed Contributor

Re: Cleaning /var

>how about the /var/spool what is use of this directory, does it contain critical files?

It contains at & cronjobs and undelivered mail.
Johnson Punniyalingam
Honored Contributor

Re: Cleaning /var

>>how about the /var/spool what is use of this directory, does it contain critical files.<<

/var/spool
This directory contains temporary spool files used in printer spooling, mail delivery, cron(1M), and other commands.

>>does it contain critical files.<<

YES.

could also please let us know are going to cleanup some files under /var/spool ..?

Thanks,
Johnson

Problems are common to all, but attitude makes the difference
Bill Hassell
Honored Contributor

Re: Cleaning /var

For any directory, the starting point is to look for the largest directories first:

du -kx /var | sort -rn | head

Then look at the largest directories. Large files may not be the problem...there may be hundreds of small files that can be removed.

As far as making anyone angry, the /var directory is like any other directory. A normal user cannot create any files in most of /var except /var/tmp. That is a directory that users must treat as temporary, but I would contact users with large files in /var/tmp before removing them. Let them know the rules such as: all files in /var/tmp older than 7 days will be automatically removed (or something similar). /tmp is the other directory that needs similar monitoring.


Bill Hassell, sysadmin
Kapil Jha
Honored Contributor

Re: Cleaning /var

first of all do a bdf and check if /vad/adm/sw is different file system.

#bdf|grep var

before running cleanup -c 1
take ignite because u wont be able to recover the system after that.

and do
#du -sk *|sort -n and check the directoreis.

Thanks
Kapil+
I am in this small bowl, I wane see the real world......