System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

/tmp is 97%, need your help friends..

redhat7012
Advisor

/tmp is 97%, need your help friends..

Hi,

 

/tmp is 97% , and I want to bring it down, please help me.

 

 

Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol4    4194304 4074704  119600   97% /tmp


# du -kx /tmp/* | sort -rn | head -n 30


440688  /tmp/TSMClient
110000  /tmp/tarzan_20120719.html.28532
109992  /tmp/tarzan_20120712.html.17545
106480  /tmp/tarzan_20120705.html.7525
106464  /tmp/tarzan_20120628.html.29744
106464  /tmp/tarzan_20120621.html.15679
106464  /tmp/tarzan_20120614.html.21551
106464  /tmp/tarzan_20120607.html.28952
105288  /tmp/tarzan_20120531.html.7919
103816  /tmptarzan_20120524.html.1114
103816  /tmp/tarzan_20120516.html.29629
103816  /tmp/tarzan_20120509.html.18517
102512  /tmp/tarzan_20120328.html.4728
102504  /tmp/tarzan_20120425.html.6227
102504  /tmp/tarzan_20120418.html.18719
102504  /tmp/tarzan_20120404.html.5533


 

what can i do now ?

 

 

4 REPLIES
Matti_Kurkela
Honored Contributor

Re: /tmp is 97%, need your help friends..

Find out when the system was rebooted the last time, by running "last reboot" or "uptime".

Any files in /tmp that are older than that are most likely safe to remove.

 

For example: if "uptime" says the system has been running for 33 days, you might delete all files in /tmp that are more than 33 days old:

find /tmp -mtime +33 -type f -xargs rm -f {} \+

 

Files that are newer than the time of last reboot might still be in use by some process: use the "fuser" command to see if the files are in use or not. Do not remove any files that are still in use.

 

For example: "fuser /tmp/tarzan_*" will list all the files named like /tmp/tarzan_*. If a file is in use, the command will display the PID number(s) of the process(es) using the file.

 

It looks like you may have some application or script that uses /tmp for temporary files but does not clean them up when it's done with them. If only the latest file is in use,

MK
Dennis Handly
Acclaimed Contributor

Re: /tmp is 97%, need your help

>you might delete all files in /tmp that are more than 33 days old:
>find /tmp -mtime +33 -type f -xargs rm -f {} \+

 

I think you wanted:

find /tmp -mtime +33 -type f -exec rm -f {} +

Ken Grabowski
Respected Contributor

Re: /tmp is 97%, need your help friends..

Matti/Dennis have some good advice for cleaning the /tmp file system. However, sometimes other things get stored in or under /tmp and need to be left as they are.  Yes, thats considered bad form, but then who hasn't seen application delevopers do something stupid. So I would suggest you add a -prune to the find command at a minimum.

 

find /tmp/* -prune -mtime +33 -type f -exec rm -f {} \;

 

More importantly, it looks like you have an application  thats creating rather large temp files "tarzan" and never cleaning them up.  You need to track those files back to their application and then communicate with the owner to determine if their needed and if they need to fix their application.

 

You also have an IBM Tivoli Storage Manager rclient subdirecty that was probably used to download and install software. Thats 400MB by itself and would free up over 12%. Look for other things like that.

 

As I suggested in your "/home 100%" post, add script(s) to your cron that check on the health of your server before a problem is on you.  You need to catch file systems before they fill up. If you have JFS ora  recent version of the 11.31 OS, you can increase file systems while they are mounted. But you have to catch them before they hit 100%. Send yourself emails or SMS text accounts so you know when things need to be given attention. Filling up / or /var or /tmp filesystems can cause severe problems with your system.

 

 

 

 

Matti_Kurkela
Honored Contributor

Re: /tmp is 97%, need your help

Dennis: Yeah, I thought about the older method with xargs, noticed that this is a HP-UX board so the -exec with a + can be expected to be available, and apparently some wires got crossed in my head :-)

MK