- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Can I safely delete all files in /tmp
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 12:50 AM
тАО10-26-2005 12:50 AM
Can I safely delete all files in /tmp
Just so you know, I've ordered some new books for HP-UX so maybe my volume of questions will back off a bit ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 12:58 AM
тАО10-26-2005 12:58 AM
Re: Can I safely delete all files in /tmp
I have a cron job set up on my servers to delete anything over a week old in /tmp. It runs every Sunday. Make sure your developers aren't abusing /tmp and you should be able to do the same.
And don't let the questions back off - I read as many questions as I can, even if I can't answer them. I'm sure I learn more from other people's questions than I contribute in answers.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 01:01 AM
тАО10-26-2005 01:01 AM
Re: Can I safely delete all files in /tmp
Use the fuser command to find out if the files where used.
You can use the find /tmp -atime +7 -exec rm {} \; to delete files that where not accesed in 7 days. Use -mtime instead of atime to delete files that where not modified in 7 days.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 01:02 AM
тАО10-26-2005 01:02 AM
Re: Can I safely delete all files in /tmp
You can but depends somtimes on your applications as well. You can go ahead and delete any file which you find is not useful to you and those created on a previous date.
Same question is answered here:-
http://www.muug.mb.ca/pipermail/roundtable/2004-May/000617.html
Hope this helps.
Regards,
Syam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 01:03 AM
тАО10-26-2005 01:03 AM
Re: Can I safely delete all files in /tmp
There are potentially some files in /tmp and in /var/tmp that hold information about processes on a current running instatiation so I'd be somewhat selective.
At your option, you can enable the startup scripts to empty '/tmp' and '/var/tmp' during the startup boot sequence.
Set 'CLEAR_TMP=1' in '/etc/rc.config.d/clean_tmps'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 01:04 AM
тАО10-26-2005 01:04 AM
Re: Can I safely delete all files in /tmp
fuser -c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 01:05 AM
тАО10-26-2005 01:05 AM
Re: Can I safely delete all files in /tmp
It's also common practice to clear /tmp on reboot by setting CLEAR_TMP to 1 in /etc/rc.config.d/clean_tmps.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 01:08 AM
тАО10-26-2005 01:08 AM
Re: Can I safely delete all files in /tmp
and type:
#/usr/local/bin/lsof | awk '$9 ~ /^\/tmp/{print}'
this will print out the processes and files they have open file handles to.
hth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 01:50 AM
тАО10-26-2005 01:50 AM
Re: Can I safely delete all files in /tmp
What we are doing instead is we use a combination of find and fuser - to make sure files that are marked for deletion are not currently in use. We also search for files with matching PIDs in the file names and skip them..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 02:14 AM
тАО10-26-2005 02:14 AM
Re: Can I safely delete all files in /tmp
You can't delete safely all files from /tmp directory. If your server is not rebooted for long time the best way is to execute the command:
find /tmp -atime +n -exec rm {} \;
from crontab, where n is number of days when the files ftom tmp are accessed.
Regards,
Borislav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2005 02:22 AM
тАО10-26-2005 02:22 AM
Re: Can I safely delete all files in /tmp
A safer way to cleanup /tmp if it seems to be filling up is just run a cron that deletes everything thats x days old. a simple find command that runs daily and your /tmp should stay relatively clean.