]>
Commit | Line | Data |
---|---|---|
b739e5bc | 1 | #!/bin/sh |
2 | # | |
3 | # Script to update Moira from Registrar's "tapes". | |
4 | ||
f6d49afc | 5 | date=`date +%y%m%d` |
6 | ##### date=`expr $date - 1` # files are postdated by 1 day | |
b739e5bc | 7 | |
ca740cf9 | 8 | cd /moira/ || exit 1 |
9 | for who in staff student ; do | |
10 | if [ -f tapes/$who.input.$date.Z ] ; then | |
11 | [ -s $who.input ] \ | |
12 | && mv $who.input.0 $who.input.1 \ | |
13 | && mv $who.input $who.input.0 | |
14 | ||
15 | zcat tapes/$who.input.$date.Z | bin/$who.cvt > $who.input | |
16 | ||
17 | [ -s $who.input ] \ | |
18 | && [ `diff $who.input.0 $who.input | wc -l` -lt 500 ] \ | |
19 | && bin/$who -n $who.input > $who.output.$date 2>&1 \ | |
20 | && egrep -v "($who): (adding|updating)" $who.output.$date > $who.err 2>&1 \ | |
21 | && cat /usr/local/lib/mail_header $who.err | mail dkk | |
22 | fi | |
b739e5bc | 23 | done |