Revision 11062,
702 bytes
checked in by ghudson, 26 years ago
(diff) |
From nathanw: rewrite in sh. Some differences:
* /usr -> /var in /usr/tmp, /usr/preserve.
* Ignore /usr/spool/rwho.
* Ignore old platforms.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | # $Id: clean_tmp_areas.sh,v 1.9 1998-01-21 21:53:02 ghudson Exp $ |
---|
3 | # Script to clean up some temporary areas in a vaguely general manner. |
---|
4 | |
---|
5 | PATH=/bin/athena:/bin:/usr/bin |
---|
6 | dirs=/tmp:"-atime +1":/var/tmp:"-atime +2":/var/preserve:"-mtime +3" |
---|
7 | |
---|
8 | xdev=-mount |
---|
9 | exceptions="! -type b ! -type c" |
---|
10 | args= |
---|
11 | |
---|
12 | case `machtype` in |
---|
13 | sun4) |
---|
14 | exceptions="$exceptions ! -type p ! -name ps_data" |
---|
15 | ;; |
---|
16 | sgi) |
---|
17 | exceptions="$exceptions ! -type p ! -type s ! -user root" |
---|
18 | ;; |
---|
19 | esac |
---|
20 | |
---|
21 | oldifs="$IFS" |
---|
22 | IFS=: |
---|
23 | set -- $dirs |
---|
24 | IFS="$oldifs" |
---|
25 | while [ $# -gt 1 ]; do |
---|
26 | if cd $1; then |
---|
27 | find $args . $xdev $2 $exceptions -exec rm -f {} \; -print |
---|
28 | find $args . $xdev -depth ! -name . -type d -mtime +1 -exec rmdir {} \; -print |
---|
29 | fi |
---|
30 | shift 2 |
---|
31 | done |
---|
Note: See
TracBrowser
for help on using the repository browser.