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 | |
---|
5 | PATH=/bin/athena:/bin:/usr/bin |
---|
6 | export PATH |
---|
7 | |
---|
8 | dirs=/tmp:"-atime +1":/var/tmp:"-atime +2":/var/preserve:"-mtime +3" |
---|
9 | xdev=-mount |
---|
10 | exceptions="! -type b ! -type c ! -type p ! -type s" |
---|
11 | args= |
---|
12 | |
---|
13 | case `machtype` in |
---|
14 | sun4) |
---|
15 | exceptions="$exceptions ! -name ps_data" |
---|
16 | ;; |
---|
17 | sgi) |
---|
18 | exceptions="$exceptions ! -user root" |
---|
19 | ;; |
---|
20 | esac |
---|
21 | |
---|
22 | oldifs="$IFS" |
---|
23 | IFS=: |
---|
24 | set -- $dirs |
---|
25 | IFS="$oldifs" |
---|
26 | while [ $# -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 |
---|
32 | done |
---|
Note: See
TracBrowser
for help on using the repository browser.