Re: Clearing /var/tmp on boot

From: Garance A Drosihn <drosih_at_rpi.edu>
Date: Mon, 28 Dec 2009 20:21:47 -0500
At 10:56 PM +0000 12/27/09, Pegasus Mc Cleaft wrote:
>
>	Should the /var/tmp directory be cleaned on bootup? To me, it
>looked like it should as many of the files in the KDE directory were
>partial download files many months old.

As others have already noted, you wouldn't want to blindly remove
everything in /var/tmp on reboot.

I've been saved several times by something left in /var/tmp, so I'd
be even a bit more paranoid about removing things than other people
have suggested.  I wouldn't remove things based on last-modification
time, since you may have some important backup files there which
have much older last-modification times.  You could also get royally
screwed up if you happen to have some kind of error with the time-
of-day clock.  (I've had machines which might boot up with the wrong
time after they had been powered off for awhile, or if rebooting
between OS's).

What I'd suggest is to create a sub-directory under /var/tmp using
some good naming convention based on the time of day at time of
reboot.  And then select files based on whatever criteria you want,
and MOVE them into the sub-directory that you've created.  Then at
some later time you could remove that sub-directory if you know
you've been up for awhile and you haven't had any need for any of
those files.

I realize this may seem like overkill, but every five or ten years
that extra step may save you from a lot of grief!

-- 
Garance Alistair Drosehn            =   gad_at_gilead.netel.rpi.edu
Senior Systems Programmer           or  gad_at_freebsd.org
Rensselaer Polytechnic Institute    or  drosih_at_rpi.edu
Received on Tue Dec 29 2009 - 01:34:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:59 UTC