From: dkk Date: Sun, 27 Nov 1994 08:20:36 +0000 (+0000) Subject: Initial revision X-Git-Tag: OPSSRC_BASE~20 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/b739e5bc42b037d7f2745bb2bd68474f958f0230 Initial revision --- diff --git a/regtape/mail_header b/regtape/mail_header new file mode 100644 index 00000000..6a7db668 --- /dev/null +++ b/regtape/mail_header @@ -0,0 +1,4 @@ +From: root@Moira.mit.edu +Subject: staff/students load report +Reply-to: moira-admin@mit.edu + diff --git a/regtape/reg-update b/regtape/reg-update new file mode 100644 index 00000000..e00cf93d --- /dev/null +++ b/regtape/reg-update @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Script to update Moira from Registrar's "tapes". + +date=`/usr/local/bin/gdate +%y%m%d` +date=`expr $date - 1` + +for who in staff students ; do + [ -f /moira/tapes/$who.input.$date.Z ] \ + && cd /moira/ \ + && mv $who.input.0 $who.input.1 \ + && mv $who.input $who.input.0 \ + && zcat tapes/$who.input.$date.Z > $who.input \ + && [ `diff $who.input.old $who.input | wc -l` -lt 500 ] \ + && bin/$who -n $who.input > $who.output.$date 2>&1 \ + && egrep -v "($who): (adding|updating)" $who.output.$date > $who.err 2>&1 \ + && cat /usr/local/lib/mail_header $who.err | mail dkk +done