[comp.unix.questions] Your favourite rm in /tmp

maart@cs.vu.nl (Maarten Litmaath) (08/07/90)

In article <58702@bbn.BBN.COM>,
	cosell@bbn.com (Bernie Cosell) writes:
)trt@rti.rti.org (Thomas Truscott) writes:
)
)}	(rm -f /tmp/*)			# Recommended
)}seems wiser, particularly since files in /tmp can be named "-r" or "-i".
)
)On the other hand, adding '-r' makes some sense, unless you'd really like to
)leave a subdirectory of /tmp around forever.  Also, I do "rm -f /tmp/.*"
)[*NO* '-r' on this one, thank you very much! :-)].

``On the other hand, adding '-r' makes some sense, unless you'd really like to
leave a subdirectory of /tmp around forever.''  Sic!
Also:
	$ rm -r . ..
	rm: cannot remove `.' or `..'
	rm: cannot remove `.' or `..'

Whatever:

	$ rm .??* .[!.]		# not portable to every UNIX version
--
   "UNIX was never designed to keep people from doing stupid things, because
    that policy would also keep them from doing clever things."  (Doug Gwyn)

mwm@raven.pa.dec.com (Mike (Real Amigas have keyboard garages) Meyer) (08/07/90)

In article <7249@star.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:

	   $ rm .??* .[!.]		# not portable to every UNIX version

Doing it the hard way, eh? I like:

/etc/unmount /dev/rz3a		# just to make sure it's unmounted.
/etc/newfs /dev/rrz3a rz55

Then let the system mount it with everything else.

	<mike
--
When all our dreams lay deformed and dead		Mike Meyer
We'll be two radioactive dancers			mwm@relay.pa.dec.com
Spinning in different directions			decwrl!mwm
And my love for you will be reduced to powder

andys@ulysses.att.com (Andy Sherman) (08/22/90)

In article <7249@star.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
>``On the other hand, adding '-r' makes some sense, unless you'd really like to
>leave a subdirectory of /tmp around forever.''  Sic!
>Also:
>	$ rm -r . ..
>	rm: cannot remove `.' or `..'
>	rm: cannot remove `.' or `..'
>
>Whatever:
>
>	$ rm .??* .[!.]		# not portable to every UNIX version

Umm, be careful.  We had a mysterious problem here with X11, where
after about 3 days new clients could not be started up to
DISPLAY=unix:0.0.  I finally figured out that our /tmp cleanup script,
which gets rid of trash which has not been accessed for 3 days, was
removing the UNIX(R) domain socket from /tmp/x11-unix.  :-(.
(Hint, only trash real files, and then remove empty directories.)

Andy Sherman/AT&T Bell Laboratories/Murray Hill, NJ
AUDIBLE:  (201) 582-5928
READABLE: andys@ulysses.att.com  or att!ulysses!andys
What? Me speak for AT&T?  You must be joking!

peter@ficc.ferranti.com (Peter da Silva) (08/24/90)

In article <13633@ulysses.att.com> andys@ulysses.att.com (Andy Sherman) writes:
> which gets rid of trash which has not been accessed for 3 days, was
> removing the UNIX(R) domain socket from /tmp/x11-unix.  :-(.

What was it doing there? A socket can be anywhere... how about /dev?

> (Hint, only trash real files, and then remove empty directories.)

How about "don't put permanent files in /tmp"?
-- 
Peter da Silva.   `-_-'
+1 713 274 5180.   'U`
peter@ferranti.com

diamond@tkou02.enet.dec.com (diamond@tkovoa) (08/27/90)

In article <13633@ulysses.att.com> andys@ulysses.att.com (Andy Sherman) writes:

>Umm, be careful.  We had a mysterious problem here with X11, where
>after about 3 days new clients could not be started up to
>DISPLAY=unix:0.0.  I finally figured out that our /tmp cleanup script,
>which gets rid of trash which has not been accessed for 3 days, was
>removing the UNIX(R) domain socket from /tmp/x11-unix.  :-(.

You mean you put a non-temporary file in /tmp?  Maybe you were asking
for trouble.  If I want a file to last even a day, I put it somewhere
other than /tmp or /usr/tmp.

Incidentally, speaking of cleanup problems, be careful if it's possible
to link another machine's disk into /tmp.  Yeah, like if someone's
testing nfs or a competitor of nfs, so "find" thinks it sees ordinary
disks (not type nfs) and goes ahead and wipes out the served disk.
(No, it didn't happen here.)
-- 
Norman Diamond, Nihon DEC       diamond@tkou02.enet.dec.com
Steering like a sports car:  I use opinions; the company uses the rack.