110.clean-tmps revision 44926
1#!/bin/sh
2#
3# $Id: 110.clean-tmps,v 1.3 1997/09/11 15:21:30 ache Exp $
4#
5# Use at your own risk, but for a long-living system, this might come
6# more useful than the boot-time cleaning of /tmp.  If /var/tmp and
7# /tmp are symlinked together, only one of the below will actually
8# run.
9#
10
11exit 0		# do not run by default
12
13if [ -d /tmp ]; then
14    cd /tmp && {
15	find . -type f -atime +3 -ctime +3 ! -name '.X*-lock' -delete
16	find -d . ! -name . -type d -mtime +1 -delete
17    }
18fi
19
20if [ -d /var/tmp ]; then
21    cd /var/tmp && {
22	find . ! -name . -atime +7 -ctime +3 -delete
23	find -d . ! -name . ! -name vi.recover -type d -mtime +1 -delete
24    }
25fi
26