cleaning up /tmp (was Re: files recovery after rm?)

Evelyn C. Leeper ecl at cbnewsj.ATT.COM
Mon Nov 13 11:04:52 AEST 1989


In article <815 at ccssrv.UUCP> perry at ccssrv.UUCP (Perry Hutchison) writes:
> In article <20551 at unix.cis.pitt.edu> yahoo at unix.cis.pitt.edu (Kenneth L Moore)
> writes:
> >This should be addressed by the systems people. I would think that a
> >program to clean /tmp on an as needed basis would be appropriate.
> It is certainly possible, and probably advisable, to have a script which
> removes anything in /tmp which has not been {accessed|modified} (pick one)
> in, say, a week.  Such a script can be run by cron in the wee hours.

/tmp is for temporary files, such as those created by compilers and so on as
interim steps.  It is not for people to throw all sorts of stuff in for someone
else to figure out how to clean up.

Of course, cleaning /tmp is advisable, but we've found that files can't hang
around a week before /tmp gets full--we give them 24 hours and then out.  It
would be nice to give them longer but disk space (even /tmp) is not free and
too many people write programs that create *huge* files in /tmp and then don't
remove them on exiting.  (We're talking 4-megabyte files here, folks!)  In
fact, on some systems, six hours is the best people can expect before files are
jettisoned.

If people started using /tmp as a temporary wastebasket in addition, it would
end up that files would get cleaned out after an hour or two (and yes, there
are ways to do that!).  Even so, I suspect many programs would start failing
for lack of space.  People who want to tie up space should do it in their home
directories where they will inconvenience only the people in their filesystem,
where they will be charged for the space, and from which they can clean up with
a script such as:
	find $WASTEBASKET -atime +2 -print | xargs rm -f 2>/dev/null
in their .profile or personal crontab (if such a feature is offered on their
system).  As a system administrator, I'm tired of having to find new and
innovative ways to clean up after the new and innovative ways people have for
eating up common disk space.

On the other hand, they may leave their laundry lying around their house for
someone else to pick up after as well....

Evelyn C. Leeper  |  +1 201-957-2070  |  att!mtgzy!ecl or  ecl at mtgzy.att.com
--
If I am not for myself, who is for me?  If I am only for myself what am I?
And if not now, when?  --Hillel



More information about the Comp.unix.questions mailing list