[comp.bugs.sys5] cleaning sticky directories

ecl@mtgzy.UUCP (Evelyn C. Leeper) (03/21/88)

In article <7476@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
> [re /tmp and /usr/tmp being shipped "sticky"]
> the system administrator ends up having to periodically clean out
> /tmp and /usr/tmp.  With this new scheme, he'll have to become
> superuser to do this, unless a privileged operator-executable
> cleanup utility is provided (or the system is rebooted and does
> this on each reboot).

As a system administrator, I don't enjoy "baby-sitting" /tmp and /usr/tmp.
So I don't--I use the cron to do cleanups (with a shell script):
	touch /tmp /usr/tmp
	find /tmp -type f -mtime +0 -print | xargs rm -f 2>/dev/null
	find /usr/tmp -type f -mtime +2 -print | xargs rm -f 2>/dev/null
(You can change the time as necessary.  It's a little trickier if you need to
do cleanups of files based on hours rather than days, but it can be done.)
I also use this script to send me mail if /usr is starting to run low and lots
of other neat things.

Moral: Use the cron!

					Evelyn C. Leeper
					201-957-2070
				UUCP:	mtune!mtgzy!ecl or ecl@mtgzy.att.com
				ARPA:	ecl%mtgzy@att.arpa