summaryrefslogtreecommitdiffstats
path: root/etc/periodic/daily/110.clean-tmps
blob: 21fbada72c45fb9a4dba0f77ee45e94ed6e76aa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
#
# $Id: 110.clean-tmps,v 1.3 1997/09/11 15:21:30 ache Exp $
#
# Use at your own risk, but for a long-living system, this might come
# more useful than the boot-time cleaning of /tmp.  If /var/tmp and
# /tmp are symlinked together, only one of the below will actually
# run.
#

exit 0		# do not run by default

if [ -d /tmp ]; then
    cd /tmp && {
	find . -type f -atime +3 -ctime +3 ! -name '.X*-lock' -delete
	find -d . ! -name . -type d -mtime +1 -delete
    }
fi

if [ -d /var/tmp ]; then
    cd /var/tmp && {
	find . ! -name . -atime +7 -ctime +3 -delete
	find -d . ! -name . ! -name vi.recover -type d -mtime +1 -delete
    }
fi
OpenPOWER on IntegriCloud