Operating System - HP-UX
1748218 Members
4567 Online
108759 Solutions
New Discussion юеВ

Re: removing files from /var file system

 
SOLVED
Go to solution
Shivkumar
Super Advisor

removing files from /var file system

Dear Sirs,

We get alerts from the /var file system getting filled up.
We are thinking remove some depot file from there. I am not sure after installation of patches, can we remove
the depot files from there ? Will it have any impact on the already installed binary ?

Which are directories under /var file system from where we can delete the files ?

Thanks,
Shiv
18 REPLIES 18
Deoncia Grayson_1
Honored Contributor
Solution

Re: removing files from /var file system

you do not want to delete any depots under /var, what you might consider doing is running cleanup -c 1 which commits any patches that has been superseded one time and also check for /var/preserve which sometimes can have huge files and make sure you have a trim script in place that will keep syslogs/mail/cron logs from becomming to large and also monitor the size of wtmp which is located under /var/adm

BTW what is the size of var on your server?
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Andy Torres
Trusted Contributor

Re: removing files from /var file system

You decide if you want to keep the original depot or not. Take a backup if possible, or copy it to another filesystem with plenty of space. From there you can gzip it, back it up, THEN remove it if it makes you feel more comfortable.

Do a swlist -l depot to see if the depot is a registered depot. If you no longer need the depot, do a swreg -u -l depot /path/to/depot to unregister it.
Andy Torres
Trusted Contributor

Re: removing files from /var file system

To be clear, I am not advocating the removal of any software under /var/adm/sw. When I say "original depot" I mean the one you downloaded and installed.

For example, I have a depot I downloaded from HP located under /var/tmp/ANDY/PRM_PATCHES/depot. Once I installed it I verified the installation (swlist -l fileset -a state | grep -v "^#" | grep -v configured). Only then did I comfortably remove /var/tmp/ANDY and unregister the depot.
James R. Ferguson
Acclaimed Contributor

Re: removing files from /var file system

Hi Shiv:

Whatever you do, do NOT manually maintain '/var/adm/sw'. This is your IPD (Installed Product Database) used by 'swinstall' and the other Software Distributer tools.

The safest way to regain space is to run 'cleanup -c 1'. This removes all but one roll-back patch imsage.

If you have "*.depot" files and or patches (PH*_*) in '/var/tmp' then these can be removed when you are done with them, without harm.

Regards!

...JRF...

Regards!

...JRF...
Justin_132
Advisor

Re: removing files from /var file system

Hi Shiv,

Y cant u try a "find" for logs inside your /var before thinking of cleaning up your sw and patches..

Some of your applications can keep old logs files which can be deleted. Even you can search for "core" dumps and touch that..

Just_In
Geoff Wild
Honored Contributor

Re: removing files from /var file system

For cleaning patches:

cleanup -c 1

To check other possibilities:

du -sk /var/* |sort -n

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Andy Torres
Trusted Contributor

Re: removing files from /var file system

The cleanup utility is a good idea. You can run it in preview mode first (cleanup -p -c 1) to see what you will gain. If you upgraded to 11.x from 10.x, the -i option can suprise you.

Read the man page on cleanup so you fully understand the weight of committing patches.

I usually start with 'cleanup -p -c 2' and get more brave from there, depending on the server (production/development).
Rick Garland
Honored Contributor

Re: removing files from /var file system

This command may help

# cd /var
# du . -ka -x | sort -nr | more

This du command will list the files in ascending order by sizes.

As previously stated, use cleanup command to reduce the patch database size.

Also look in the /var/adm/syslog. Do you have large syslog.log and/or mail.log files?

Is the crash directory on the same mount point as /var? Do you have crash dumps in there?
You may want to put the /var/adm/crash on its own filesystem.
Raj D.
Honored Contributor

Re: removing files from /var file system

Hi Shiv ,

Check for the big files under /var and you can find some big files or logs.
You can use :
# bdf | grep var # ( check if only var mount point exists).

# cd /var
# ls -lR | sort +4 -5nr | more
( It will show all the biggest files one by one..)



Also check for
/var/adm/syslog/syslog.log
/var/adm/syslog/OLDsyslog.log
/var/adm/syslog/mail.log
/var/adm/wtmp
/var/adm/cron/log

You can nullyfy the files or move to other place to recover free space.


Cheers,
Raj.

" If u think u can , If u think u cannot , - You are always Right . "