1826480 Members
4248 Online
109692 Solutions
New Discussion

clean system

 
SOLVED
Go to solution
Slawek Ksiazek
Regular Advisor

clean system

Hi

I looking for if exists some script, program to clean old logs, files, HPUX, generaly files which are unnecessary.How can i clean my filesystem :o) Thanks for info,

Slawek
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: clean system

Hi:

Aside from trimming log files (primarily in '/var/adm') you probably want to reclaim some space in '/var'.

Never manually manage the '/var/adm/sw' directory. It is your IPD (installed Product Database) and as such it is essential to being able to patch and add or remove software. Instead, you can run:

# cleanup -c 1

...to remove rollback images of patches that have been superceded at least once. If you have never done this, but have patched routinely, you will be suprised at the amount of space that might be returned.

As always, a good Ignite backup is always a good thing to have.

Regards!

...JRF...
Adam W.
Valued Contributor

Re: clean system

James's post is an excelent way to clear out old patches and whatnot. Somehting else you may want to try is:

find /var -xdev -depth -size +7000 â xdev -exec ll {} \; | more

This will find files larger than 7000k you can easily add a grep in there to find only .log files. AND you can replace the ll with rm to remove them, however ALWAYS run the ll first to ensure your not deleting anything needed by the system.

One other trick I like to use is touch. See below:

To remove dated files. Can be modified to remove sized files as well.


# touch -amt 200504150000 /tmp/ref1
# touch -amt 200802282359 /tmp/ref2

# find /opt/mtmc/ibs/import/reject -xdev -type f -newer /tmp/ref1 -a ! -newer /tmp/ref2 -exec rm {} \+

This will remove files that are newer (more recently modified) than April 15 at 0000 AND NOT newer than Feb, 28th 2359 of this year
This can be easily modified to do any number of tasks. Hope this helps.
There are two types of people in the world, Marines and those who wish they were.
Slawek Ksiazek
Regular Advisor

Re: clean system

ok, thanks