- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Temportay file deletion
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
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
тАО08-09-2007 11:41 PM
тАО08-09-2007 11:41 PM
Temportay file deletion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2007 11:46 PM
тАО08-09-2007 11:46 PM
Re: Temportay file deletion
cd /tmp
find . -mtime +7 -exec rm {}\;
If there's still a problem I look at the largest files:
ll|sort -k5,5nr|pg
Unless the file at the top is very new I would be inclined to get rid of it.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2007 11:48 PM
тАО08-09-2007 11:48 PM
Re: Temportay file deletion
is anything necessary to be recovered that used to be in a lost /tmp filesystem?
Maybe this will answer it a little.
On Solaris boxes the /tmp filesystem is merely part of swap,
which means that you get an autoclaen of its content whenever you reboot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2007 11:52 PM
тАО08-09-2007 11:52 PM
Re: Temportay file deletion
You can also clear the tmp dir automaticaly at every reboot by changing the paramater
CLEAR_TMP in /etc/rc.config.d/clean_tmps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-09-2007 11:53 PM
тАО08-09-2007 11:53 PM
Re: Temportay file deletion
What find can be deleted depends on what is there and who owns it.
The general purpose of the directory is temp files and the directory is normally read-write-execute for all users.
What sometimes happens is congestion and applications not cleaning up after themselves.
Normally I handle it with a cron job that gets rid of files not accessed in the last 7 days.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2007 12:01 AM
тАО08-10-2007 12:01 AM
Re: Temportay file deletion
-----------------------------------------
/tmp is one of those directories where everyone has access but few seem to
treat it with respect. /tmp is defined as a temporary storage area and is
not to be considered permanent. Processes like email or the vi editor use
the /tmp directory for files, but normal operations will cleanup afterwards
and not leave files in the /tmp directory. Some HP programs will leave
their logfile in /tmp, but this is considered correct practice in
that the logfile should be reviewed for errors, and then removed or archived.
There is a caveat that customers who are running Omniback should be
aware of. Omniback require that a file called CRS.pid exist in the /tmp
directory. Otherwise Omniback will not work.
One way to enforce cleanup of the /tmp directory is to use a command such as:
find /tmp -type f -atime +14 -exec rm {} \;
which will remove any files in /tmp (or files in directories below /tmp)
that have not been accessed in more than 14 days. The other temporary
storage area, /var/tmp, is less often abused by users since they overlook
it's existence. Again, some processes will create temporary files in
/var/tmp and should (if they terminate correctly) remove their files
and editors like vi use /var/preserve. This command
will clear up /var/tmp of files not accessed in more than 7 days:
find /var/tmp -atime +7 -exec rm {} \;
System administrators need to decide if /tmp should allow regularly accessed
files to stay in /tmp. A user might bypass the above tests by using the
touch command on the files. In this caase, change the -atime option to
-mtime which means that the file must be modified.
Once in a while, you may need to check for old directories which are not
removed by the above command. The contents will be cleared but after a
while, /tmp may get cluttered with empty directories.
Here's a possibility for files in directories. This combination purges
files that are older than 7 days, followed by a removal of the directory
if it hasn't been updated for 7 days. However, a simple rmdir is used
so the command will fail if the directory isn't empty. Thus, until all
files have been removed, the directory will stay.
find /tmp -type f -atime +7 -print -exec rm -f {} \;
find /tmp -type d -atime +7 -print -exec rmdir {} \;
find /var/tmp -type f -atime +7 -print -exec rm -f {} \;
find /var/tmp -type d -atime +7 -print -exec rmdir {} \;
Another common practice is to cleanup /var/tmp after every full backup.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2007 12:08 AM
тАО08-10-2007 12:08 AM
Re: Temportay file deletion
Everything depends on your management scheme. As noted, you can elect to automatically remove everything in the '/tmp' directory during reboot and startup, by setting CLEAR_TMP=1 in '/etc/rc.config.d/clean_tmps'.
Strictly speaking, according to standards [see the 'hier(5)' manpages], the '/tmp' directory is for *system* temporary files whereas '/var/tmp' is intended for *application* files.
My preference is not to automatically clean the '/tmp' directory, but periodically purge (manually and programatically) what I don't want. I don't want '/tmp' automatically cleaned upon reboot in order to preserve patch depots and/or individual patches that I may have staged there for installation following a reboot "health-check" prior to installation.
Regards!
...JRF...