1829752 Members
1615 Online
109992 Solutions
New Discussion

how to clear VAR folder

 
SOLVED
Go to solution
Vu_9
Occasional Contributor

how to clear VAR folder

Dear All,

the folder /var is full, i don't know what 's file . I can remove it, please help me!

Many thanks.
5 REPLIES 5
Adisuria Wangsadinata_1
Honored Contributor
Solution

Re: how to clear VAR folder

Hi,

You can try several ways to do housekeeping on /var file system :

1. Cleanup the crash directory at /var/adm/crash. When the system having a problem (panic or rebooting by itself), the system usually create a crash dump information on this directory. You can cleanup the un-necessary info at this directory (check the timestamp).

2. Using 'cleanup' command for patch cleanup utility, check the man page for more detail :

# man cleanup

Example :

Preview:
#cleanup -p -c 2

Clean:
#cleanup -c 2

3. Using SAM to trim-out the log files :

SAM -> Routine Tasks -> System Log Files -> [Select a log file] -> Actions -> Trim

Check the thread below for your reference :

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=977812

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
RAC_1
Honored Contributor

Re: how to clear VAR folder

Be careful about what you remove.
du -kx /var | sort -n

will give ascending list by usage.
There is no substitute to HARDWORK
Ivan Ferreira
Honored Contributor

Re: how to clear VAR folder

Use:

find /var -type f -exec ls -l {} \; |sort +5 -nb

To find the largest files. It may be unreaded mail in /var/spool/mail also.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Muthukumar_5
Honored Contributor

Re: how to clear VAR folder

/var directory will contain log files, installed softwares.

You can get most directory using files as,

# du -k /var | sort -rnk1

You can delete all OLD* logs firstly as,

# find /var -name "OLD*" | xargs rm -f

You can found installed superseeded patches to be cleanup as,

# cleanup -p -c 2
# cleanup -c 2

to clean it up.

You can trim log files of all daemons as well.

hth.
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: how to clear VAR folder

If you have a similar machine with same level patches then you can remove /var/adm/sw/save/ PHCO_* details too.

hth.
Easy to suggest when don't know about the problem!