Main Topics
Browse All TopicsWe have these HP-UX boxes running oracle databases on them. Due to heavy activity on the server the oracle /tmp directory gets filled up pretty quickly which eventually is causing space issues. I would thus need a unix(HP-UX) shell script which would look at the /tmp directory size and purge its contents once it reaches 70% of its size and would also notify me about the purge on my email. It is a HP-UX server.
Thank You
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I think tfewster's `rm` solution in that PAQ is a bit risky - What if a file is in use? The process writing to it will keep writing and hence the file will keep growing, but it won't be visible to ls or du so you could run out of disk space but not be able to find the culprit. For each file, use `fuser <filename> 2>/dev/null` to see if there are any processes writing to the file.
You also need to consider if files that are _not_ open all the time are still essential to the running app for reference. Any files older than the last time the app was started are probably not essential . So before running an automatic purge, you should decide what rules to use to decide if a file can be deleted. Though any app developer who puts non-temporary files in a tmp directory needs to be shot. As well as ones that don't clear up their own tmp files once they're no longer needed! But maybe backing up the files before deleting them would be sensible.
If your app startup could purge the directory or at least create a timestamp file [to use with `find /tmp ! -newer timestamp_file -exec rm {} \;` ], that would be safer. Clearing down the directory at boot time is also sensible (the HP-UX default in the config file under /etc/rc.config.d ["tmp"?] is to list files rather than delete).
Oracle is fairly well behaved in that respect, but you might want to add Oracle to the zones this question is visible in. The DBAs should be able to advise on managing Oracle tmp files. I'm assuming these aren't archive/redo logs, that are needed in case of crashed or corruption...
By the way, you probably want to use `bdf` rather than `df` on an HP-UX server.
See the attached code snippet for a more cautious approach
Business Accounts
Answer for Membership
by: ghostdog74Posted on 2009-03-19 at 20:07:21ID: 23936596
check <font id="linkPlaceHolder"></fon t>