1752433 Members
6122 Online
108788 Solutions
New Discussion юеВ

Re: /var full

 
SOLVED
Go to solution
Jayraj
Frequent Advisor

/var full

Hi all,

I have /var full, what are all the files we can trim in /var directory. Here I am providing the du -sk|sort -rn output.

3251712 /var/adm
547472 /var/mqm
158584 /var/opt
80032 /var/stm
22392 /var/preserve
10144 /var/tombstones
6760 /var/mail
6656 /var/dmi
2936 /var/mfaslmf
848 /var/sam
648 /var/spool
624 /var/vx

and


2003064 /var/adm/sw
669256 /var/adm/syslog
557448 /var/adm/crash
11304 /var/adm/sa
6512 /var/adm/perfmgr
3320 /var/adm/cron
344 /var/adm/wtmp
200 /var/adm/btmp

10 REPLIES 10
Suraj K Sankari
Honored Contributor

Re: /var full

Hi,

1.You can trim /var/adm/wtmp and /var/adm/btmp
2.Check how many syslog.log is there under /var/adm/syslog if any old then you can delete
3.Is you /var/adm/crash is under /var filesystem if yes check old files or take backup of old files and remove from /var/adm/crash.
4.Check old files /var/spool/adm if you are not using printer then you can delete spool files.

Apart from this check any open file is there or not with
lsof command

Suraj
Ganesan R
Honored Contributor
Solution

Re: /var full

Hi Swaraj,

It looks you have not committed the patches.
Run the below command to commit the patches which has 1 level superseded.

#cleanup -c 1

You can remove the old crash directory under /var/adm/crash.

#cd /var/adm/crash
#rm -r crash.X

Look into /var/adm/syslog. Delete or trim mail log file old syslog files.

# > mail.log
# > OLDsyslog.log
Best wishes,

Ganesh.
Joachim Noffke
Occasional Advisor

Re: /var full

Since /var/adm/sw is by far the largest directory, it will probably make sense to clean up old patches using the "cleanup" command:

# cleanup -c 2

This will throw away all old backup copies of patches which have been superseded at least two times. The respective files in /var/adm/sw/save will be deleted. (Important: don't do this manually! Use the above command.)

If there is still not enough free space afterwards, you can try "cleanup -c 1" which will leave only the backup copies of one generation of superseded patches on your disk. This means that, if you ever need to remove a bad patch, you still can go back one step in history, which should be enough.

The cleanup command has a '-p' option which allows you to check beforehand how much disk space can be freed (but doesn't do anything yet).

Hope this helps.
Steven E. Protter
Exalted Contributor

Re: /var full

Shalom,

sam has a handy little tool called trim logs under routine tasks that can quickly clean this up.

What I see is a lot of logs that have never been trimmed, mostly shown in the second paragraph of output.

I'd either use sam or write a script that copies these logs off and clears them once a week.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
unixguy_1
Regular Advisor

Re: /var full

Hi Swaraj,

First we have to check whether there is any crash dumps is avialble or not,if it's there remove it and take the backup of below mentioned files ,if it isd not reqired.

/var/adm/syslog/syslog.log
/var/adm/syslog/OLDsyslog.log
/var/adm/syslog/mail.log

then check any core file is there or not,use below mentioned command

# find /var -type f -name core

and search big file in our server.

#find /var -size+10000 -print

(Morethan 10 mB files)

afetr thatc heck any other old packages in our system.

use bwlo mentioned command.

#cleanup -c 1

I hope the above mentioned steps is useful for ur requirements.

Regards,
Unixguy.


Jayraj
Frequent Advisor

Re: /var full

Thank u ganesan..
now I have space , however I am not sure wt is cleanup -c..where can I get the more information on this command..
Joachim Noffke
Occasional Advisor

Re: /var full

There is a manpage for cleanup.
Suraj K Sankari
Honored Contributor

Re: /var full

Hi,

click the below link for cleanup

http://www.manpagez.com/man/8/cleanup/

suraj
Steven E. Protter
Exalted Contributor

Re: /var full

Shalom,

cleanup -c 1

I use it to clean up the patches that have been superseded once.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com