- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: /var/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
Forums
Discussions
Discussions
Discussions
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
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-23-2000 05:01 AM
10-23-2000 05:01 AM
Can the experts tell me what /var/tmp is used for and under what criteria they remove the files in that directory. Is there some doc on the recommeded removal period like 30 days after last reboot?
TIA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 05:10 AM
10-23-2000 05:10 AM
Re: /var/tmp
I would delete files older than 3 days..
federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 05:10 AM
10-23-2000 05:10 AM
Re: /var/tmp
files under /var/tmp are usualy temporary files the can be removed after each reboot.
User have to take care not storing any important data at this location.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 05:16 AM
10-23-2000 05:16 AM
Re: /var/tmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 05:22 AM
10-23-2000 05:22 AM
Solution/var/tmp/ can most certainly be cleaned up. Temporary files from script installs are placed here as are vi recovery files. The vi recovery files have the format "Ex
# find /var/tmp -mtime +30 -exec rm {} \;
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 05:45 AM
10-23-2000 05:45 AM
Re: /var/tmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 05:51 AM
10-23-2000 05:51 AM
Re: /var/tmp
let me correct Chris reply:
Yes there is a file /sbin/init.d/clean_tmps BUT when you're looking in it you will find that ONLY /tmp is cleaned, NOT /var/tmp.
(/var/tmp is only listed, not cleaned)
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2000 06:00 AM
10-23-2000 06:00 AM
Re: /var/tmp
# ll /var/tmp
-rw-r--r-- 1 root sys 1241 AAAa00396
# file AAAa00396
English Text
# more AAAa00396
======= 10/16/00 10:49:01 EDT BEGIN swinstall SESSION (interactive)
NOTE: The interactive UI was invoked, since no software was specified.
* Session started for user "root@rong".
As you can see, this file was created by swinstall.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 10:54 AM
10-24-2000 10:54 AM
Re: /var/tmp
But why is it that you're getting permissions problems because of the old files? Are your scripts using the same temp file name over again each time they run?
If that's the case, try creating the temp file names using 'mktemp' (see the man page), or use file names that contain the process number--which should be unique most of the time--like this:
TEMPFILE="yourscript-$$.tmp" (Bourne shell)
set TEMPFILE="yourscript-$$.tmp" (C shell)
Use 'trap' (Bourne) or 'onintr' (C shell) to remove the temp files if your script terminates unexpectedly. The way I do it for Bourne shell is something like this:
# Signal '0' is a normal termination:
trap "rm -f ${TEMPFILE:?'Undefined! Not removing any files.'}" 0
# If we get signals 1, 2, or 15, exit with nonzero status (failure):
trap "rm -f ${TEMPFILE:?'Undefined! Not removing any files.'}; exit 1" 1 2 15
(I hope I didn't make any typos)