LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-23-2007, 08:27 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 73
/TMP Directory


OK - So I was told that the /tmp directory was a place I can throw stuff that is just kind of like a Recycle Bin and that Linux will auto flush this directory at some point. My question is if I move something into /tmp as "root", how long will it remain in /tmp? Does it get flushed automatically by how long it remains in /tmp or does /tmp have a size limit and once exceeded, it flushes the files?

Also can you set parameters for /tmp like auto flush every 30 days or even every 1 day?

Thanks!
 
Old 01-23-2007, 08:57 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
On most Linux systems there is an entry in the daily crontab, that every day look for files which have not accessed for a period of time (using tmpwatch) and remove them.
 
Old 01-23-2007, 09:02 AM   #3
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
To amplify on that response. /tmp itself is just a directory (or sometimes a filesystem). As such it doesn't automatically delete anything.

On Linux as the above poster said by default many distros have the tmpwatch to do cleaning. On UNIX systems some people add cron jobs to do such cleaning or startup jobs. (Years ago on AT&T UNIX the default job actually blew away the directory on reboot then recreated it.) The idea is NOT to use it for permanent storage as most admins know it is fair game and will not hesitate to blow away files there if space becomes an issue. It's a good to periodically blow things away by such a cron job as at it teacher users not to store things there the hard way.

Note there also is a /var/tmp and on some older systems a /usr/tmp.
 
Old 01-23-2007, 10:28 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Be aware that /tmp is sometimes mounted as tmpfs, i.e. a filesystem backed by virtual memory instead of directly a disk partition.

This is very good for performance, as you'll have memory access time vs disk drive access time for the temporary data placed there.

The drawback are:
- everything is lost when the system shutdowns
- very big files living in /tmp can dramatically slow down the system because of pagination.

Another point: /var/tmp is a filesystem designed to store persistant data. Only the application that create files or directory there are allowed to remove them.
You should't remove files present there (or have a daemon that do it) without knowing what you are removing.
 
Old 01-23-2007, 02:02 PM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 73
Thanks all!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/tmp directory is full? Moses420ca Linux - Newbie 13 01-21-2005 08:48 PM
Can I delete everything in the /tmp directory? BajaNick Linux - General 5 07-04-2004 02:35 PM
permissions in /tmp directory linux_pioneer Linux - Software 1 08-30-2003 11:43 PM
/tmp directory Bobmeister Linux - General 3 06-01-2003 05:32 PM
/tmp directory too small??? kazi Linux - Newbie 9 03-29-2003 01:46 PM


All times are GMT -5. The time now is 05:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration