Commit | Line | Data |
---|---|---|
d0bc5bd9 C |
1 | : run this script through /bin/sh |
2 | : nightly maintenance script for Level-1 DSA | |
3 | : contact c=@(country)@cn=Manager to get a time slot for cron to run this script | |
4 | ||
5 | W="@(dsa)" | |
6 | D=@(etcdir)quipu/@(wildlife) | |
7 | ||
8 | : make sure dish is in the search path | |
9 | PATH=${PATH-:/bin:/usr/ucb:/usr/bin}:@(bindir) | |
10 | export PATH | |
11 | ||
12 | if [ ! -d $D ]; then | |
13 | echo "unable to find database directory for $W: $D" 1>&2 | |
14 | exit 1 | |
15 | fi | |
16 | ||
17 | cd $D | |
18 | ||
19 | : first, mail the logs to the pilot project sponsors | |
20 | ||
21 | (echo "To: wpp-stats@nisc.psi.net" ; \ | |
22 | echo "Subject: $W DSA activity" ; \ | |
23 | echo "" ; \ | |
24 | cat dsap.log) | /bin/mail wpp-stats@nisc.psi.net | |
25 | ||
26 | (echo "To: wpp-stats@nisc.psi.net" ; \ | |
27 | echo "Subject: $W DSA stats" ; \ | |
28 | echo "" ; \ | |
29 | cat stats.log) | /bin/mail wpp-stats@nisc.psi.net | |
30 | ||
31 | ||
32 | : second, cycle the logs | |
33 | ||
34 | rm -f iso.*.log ros.*.log [0-9]*.log dish.log xquipu.log | |
35 | ||
36 | for A in [a-z]*.log | |
37 | do | |
38 | x=2 | |
39 | while [ $x -gt 0 ]; | |
40 | do | |
41 | y=`expr $x - 1` | |
42 | mv $A-$y $A-$x >/dev/null 2>&1 | |
43 | x=$y | |
44 | done | |
45 | ||
46 | mv $A $A-0 >/dev/null 2>&1 | |
47 | ||
48 | > $A | |
49 | chmod 666 $A | |
50 | done | |
51 | ||
52 | exit |