LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 07:27 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
/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, 07:57 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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, 08:02 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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, 09:28 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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, 01:02 PM   #5
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
Thanks all!
 
  


Reply



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 07:48 PM
Can I delete everything in the /tmp directory? BajaNick Linux - General 5 07-04-2004 01:35 PM
permissions in /tmp directory linux_pioneer Linux - Software 1 08-30-2003 10:43 PM
/tmp directory Bobmeister Linux - General 3 06-01-2003 04:32 PM
/tmp directory too small??? kazi Linux - Newbie 9 03-29-2003 12:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:32 PM.

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
Open Source Consulting | Domain Registration