Revision 23095,
1.1 KB
checked in by ghudson, 16 years ago
(diff) |
Import the moira package from SIPB Debathena.
|
Rev | Line | |
---|
[23095] | 1 | #!/bin/sh -vx |
---|
| 2 | # |
---|
| 3 | # Script to update Moira from Registrar and Personnel "tapes". |
---|
| 4 | |
---|
| 5 | if [ "filler $1" != "filler staff" -a "filler $1" != "filler student" ] ; then |
---|
| 6 | echo "Bad argument $1" |
---|
| 7 | echo "Usage: $0 [ staff | student ]" |
---|
| 8 | exit 1 |
---|
| 9 | fi |
---|
| 10 | who="$1" |
---|
| 11 | rdir=/moira |
---|
| 12 | bdir=$rdir/bin |
---|
| 13 | tdir=$rdir/tapes |
---|
| 14 | ldir=$rdir/load |
---|
| 15 | |
---|
| 16 | date=`date +%y%m%d` |
---|
| 17 | date=`expr $date - 1` # files are postdated by 1 day |
---|
| 18 | |
---|
| 19 | cd "$ldir" || exit 2 |
---|
| 20 | |
---|
| 21 | if [ -f "$tdir/$who.input.$date.Z" ] ; then |
---|
| 22 | |
---|
| 23 | if [ -f "$ldir/$who.input.$date" ] ; then |
---|
| 24 | echo "Pre-existing $ldir/$who.input.$date, will not overwrite." |
---|
| 25 | exit 3 |
---|
| 26 | fi |
---|
| 27 | |
---|
| 28 | zcat "$tdir/$who.input.$date.Z" | "$bdir/$who.cvt" \ |
---|
| 29 | > "$ldir/$who.input.$date" |
---|
| 30 | |
---|
| 31 | [ -s "$ldir/$who.input.$date" ] \ |
---|
| 32 | && [ `diff $ldir/$who.input.last $ldir/$who.input.$date |wc -l` -lt 500 ] \ |
---|
| 33 | && rm $ldir/$who.input.last \ |
---|
| 34 | && ln -s $who.input.$date $ldir/$who.input.last \ |
---|
| 35 | && $bdir/$who -n $ldir/$who.input.$date > $ldir/$who.output.$date 2>&1 \ |
---|
| 36 | |
---|
| 37 | # && egrep -v "($who): (adding|updating)" $ldir/$who.output.$date \ |
---|
| 38 | # > $ldir/$who.err.$date 2>&1 \ |
---|
| 39 | # && cat /usr/local/lib/mail_header $who.err | mail dkk |
---|
| 40 | |
---|
| 41 | fi |
---|
Note: See
TracBrowser
for help on using the repository browser.