[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clearing out /tmp



> On Sat, Apr 12, 2003 at 07:43:34AM -0500, Marcelo Medici wrote:
> > How often should /tmp be cleared of files. Is there a built in process to
> > do this?
> 
> On Red Hat boxes (at least) with tmpwatch installed, you shouldn't
> have to worry about /tmp.  (Generally speaking, anyway.)

For those of you who don't have the luxury of upgrading to Win^H^H^HRedhat
to solve a simple problem, read on.

/tmp tends to be filled with all sorts of system-related temporary files.
Another place to look is /usr/tmp or /var/tmp which is where user-related
temporary files are supposed to go, but often don't.

How often is what you asked, and the answer is "it depends".
Some folks feel this should be cleaned out on reboot, and so put a simple
"rm -rf /tmp/* /tmp/.??*" in /etc/rc.local or some other startup script
to clean it out. Many distros have such management built in and may be
controllable with various settings in /etc/sysconfig, for example.

SuSE, in specific, has a setting in /etc/sysconfig/cron called
CLEAR_TMP_DIRS_AT_BOOTUP that you set to "yes" and it will do this cleanup.
It has additional options like additional tmp directories to cleanup
and exclusion of certain files.

In the general case, it's usually easy enough to create a simple script
that performs exactly the kind of cleanup you want, and then install it
into your bootup or to run it as a cron job (excluding currently executing
cron job temporary files).

Another option could be to look at what kind of files are being left there.
Most systems have rc (startup) scripts for the various subsystems that keep
temp files around, and they are self-cleaning (i.e. they purge their own
files before starting up). If you have some system (like a webserver, perhaps)
that leaves files and never cleans up after itself, you can look at blowing
them away automatically, or adapting that service/application's startup
to clean up after itself.

Advice to "switch to Redhat and you won't have this problem" isn't, IMHO, 
the most effective response to such a problem. It also sounds a lot like 
the typical support line you get from another well known operating system.

Mike808/


---------------------------------------------
http://www.valuenet.net



-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.