Hi everyone Can I delete the contents of /tmp from time to time without upsetting the system? I use it for downloading stuff, but then delete it when installed or no longer needed. Konqueror, xcdroast and kde seem to leave amazing amounts of stuff there. Steve.
* scc
Hi everyone
Can I delete the contents of /tmp from time to time without upsetting the system?
I use it for downloading stuff, but then delete it when installed or no longer needed. Konqueror, xcdroast and kde seem to leave amazing amounts of stuff there.
/tmp is supposed to be wiped out with no reason whatsoever. So feel free to clean it up ;) -- Mads Martin Joergensen, http://mmj.dk "Why make things difficult, when it is possible to make them cryptic and totally illogic, with just a little bit more effort." -- A. P. J.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On May 14, 2001 03:12 pm, Mads Martin Jørgensen wrote:
* scc
[May 14. 2001 11:10]: Hi everyone
Can I delete the contents of /tmp from time to time without upsetting the system?
I use it for downloading stuff, but then delete it when installed or no longer needed. Konqueror, xcdroast and kde seem to leave amazing amounts of stuff there.
/tmp is supposed to be wiped out with no reason whatsoever. So feel free to clean it up ;)
Watch out for programs that are actually using entries. I've before entirely wiped /tmp and found that MySQL wasn't working. I had to restart MySQL. Now I wipe everything but /tmp/mysql.sock. :-)* Actually, I wipe anything older than my uptime or over a month old, whatever's shorter. - -- James Oakley Engineering - SolutionInc Ltd. joakley@solutioninc.com http://www.solutioninc.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE7ACRM+FOexA3koIgRAqp3AJ9gZG3ZVCZEOtkuR7W5eDYvYf1n8ACdGCHO QolbFDdJMY5CCtspogJnQGI= =+cgJ -----END PGP SIGNATURE-----
-----Original Message----- From: Mads Martin Jørgensen [mailto:mmj@suse.com] /tmp is supposed to be wiped out with no reason whatsoever. So feel free to clean it up ;)
Too bad not everyone follows the /tmp is temp rule. The MySQL install on 6.5 and I am pretty sure 7.0 put a file in /tmp mysql.sock that if removed kills MySQL. I thought a find command that killed off all files over a few days would do the trick, but found that killed off the MySQL engine. Greg Engel
genge1 wrote:
-----Original Message----- From: Mads Martin Jørgensen [mailto:mmj@suse.com] /tmp is supposed to be wiped out with no reason whatsoever. So feel free to clean it up ;)
Too bad not everyone follows the /tmp is temp rule. The MySQL install on 6.5 and I am pretty sure 7.0 put a file in /tmp mysql.sock that if removed kills MySQL.
From the Filesystem Hierarchy Standard:
Although data stored in /tmp may be deleted in a site-specific manner, it is recommended that files and directories located in /tmp be deleted whenever the system is booted.
Programs shall not assume that any files or directories in /tmp are preserved between invocations of the program.
In other words, it's OK for programs to keep a file in /tmp as long as they are running. Postgres does the same thing. -- =============================================================== Glenn Holmer (gholmer@wi.rr.com) --------------------------------------------------------------- "Linux only became possible because 20 years of OS research was carefully studied, analyzed, discussed and thrown away." --------------------------------------------------------------- -Ingo Molnar, on the Linux kernel mailing list ===============================================================
Actually, that's not the case. This is what the file system standard says:
+++++++++++++++++++
Filesystem Hierarchy Standard
3.11 /tmp : Temporary files
The /tmp directory shall be made available for programs that require
temporary files.
Although data stored in /tmp may be deleted in a site-specific manner, it
is recommended that files and directories located in /tmp be deleted
whenever the system is booted.
Programs shall not assume that any files or directories in /tmp are
preserved between invocations of the program.
START RATIONALE
IEEE standard P1003.2 (POSIX, part 2) makes requirements that are similar
to the above section.
FHS added the recommendation that /tmp be cleaned at boot time on the basis
of historical precedent and common practice, but did not make it a
requirement because system administration is not within the scope of this
standard.
END RATIONALE
+++++++++++++++++++
As you can see tmp files that belong to running programs should not be
wiped, even if they've been closed by the program - it migh want to reopen
the file and reuse the contents...
Alan
PS: the whole standard is at http://www.pathname.com/fhs/ if you are
interested :)
----- Original Message -----
From: "Mads Martin Jørgensen"
* scc
Hi everyone
Can I delete the contents of /tmp from time to time without upsetting the system?
From /etc/rc.config set them cron will take care of it
# # cron.daily can check for old files in tmp-dirs. It will delete all # files # not accessed for more than MAX_DAYS_IN_TMP. If MAX_DAYS_IN_TMP is # not set # or set to 0, this feature will be disabled. # MAX_DAYS_IN_TMP=2 # # You can specify in TMP_DIRS_TO_CLEAR, which directories have to be # searched for old files, to be deleted. # TMP_DIRS_TO_CLEAR="/tmp /var/tmp" # # In OWNER_TO_KEEP_IN_TMP, you can specify, whoms file shall not be # deleted. # OWNER_TO_KEEP_IN_TMP="" -- Togan Muftuoglu
On Mon, May 14, 2001 at 08:28:37AM +0200, scc wrote:
Hi everyone
Can I delete the contents of /tmp from time to time without upsetting the system?
This is what tmpwatch is for. It looks for any file in /tmp (or whatever other directory you configure) that hasn't been looked at in some period of time (like 10 days) and deletes those files. That way you get regular /tmp cleaning without accidentally removing a file that some program is using. I think it's configurable via YaST. -tara
participants (8)
-
Alan Lenton
-
genge1
-
Glenn Holmer
-
James Oakley
-
Mads Martin Jørgensen
-
scc
-
Tara L Andrews
-
Togan Muftuoglu