Clearing tmp files

Mr Shunz mrshunz at gmail.com
Fri Oct 12 09:39:18 UTC 2007


On 10/12/07, Peter Garrett <peter.garrett at optusnet.com.au> wrote:
> On Fri, 12 Oct 2007 08:04:16 +0200
> Mario Vukelic <mario.vukelic at dantian.org> wrote:
>
> > > Is that required in
> > > Ubuntu?
> >
> > No, /tmp is an virtual filesystem that just exists in RAM and is
> > therefore cleaned on every reboot.
>
> Mario, are you confusing tmpfs with /tmp ?
>
> As far as I can see, /tmp is a very real directory on my hard drive, not a
> volatile system in RAM . In fact, had I wanted to do so, I could have
> made /tmp a separate partition...
>

Hi,
/tmp can be mounted as a RAM fs, but generally is a physical
partition ...
>From memory, you should put smth like:

rm -fr /tmp/*

in a boot script, but not in rc.local because some daemon
could have written some files/pipes in /tmp...
I think I remember that slackware has it
ad did the remove just after the fs is mounted, checking not
to delete some .X-something ...

Or you can delete *.tmp *.bak *.jpg|png|gif just to be safe ...

Long answer short:
put rm -fr /tmp/* in a boot script, checking not to delete
needed files (you can for ex. rm -rf `find /tmp -name *.EXT`)

Cheers

-- 
Daniele Santi        .o.
daniele at santi.vr.it  ..o    |,,,/_
Linux User #415108  ooo
---------------------------------------------------------
()  ascii ribbon campaign - against html mail
/\                        - against microsoft attachments
---------------------------------------------------------




More information about the ubuntu-users mailing list