source: trunk/packs/maint/clean_tmp_areas.sh @ 12950

Revision 12950, 719 bytes checked in by kcr, 25 years ago (diff)
don't remove unix domain sockets on suns collapse -type s and -type p into the master exceptions list
  • Property svn:executable set to *
Line 
1#!/bin/sh
2# $Id: clean_tmp_areas.sh,v 1.14 1999-04-21 16:43:45 kcr Exp $
3# Script to clean up some temporary areas in a vaguely general manner.
4
5PATH=/bin/athena:/bin:/usr/bin
6export PATH
7
8dirs=/tmp:"-atime +1":/var/tmp:"-atime +2":/var/preserve:"-mtime +3"
9xdev=-mount
10exceptions="! -type b ! -type c ! -type p ! -type s"
11args=
12
13case `machtype` in
14sun4)
15        exceptions="$exceptions ! -name ps_data"
16        ;;
17sgi)
18        exceptions="$exceptions ! -user root"
19        ;;
20esac
21
22oldifs="$IFS"
23IFS=:
24set -- $dirs
25IFS="$oldifs"
26while [ $# -gt 1 ]; do
27        if cd $1; then
28                find $args . $xdev $2 $exceptions ! -type d -exec saferm {} \; -print
29                find $args . $xdev -depth ! -name . -type d -mtime +1 -exec saferm -d -q {} \; -print
30        fi
31        shift 2
32done
Note: See TracBrowser for help on using the repository browser.