]> andersk Git - moira.git/blobdiff - regtape/reg-update
DBMS=ORACLE
[moira.git] / regtape / reg-update
index cd174c6b1864a9ec3087b6f1b507f9a18dd24c2f..28ee8e65a6c60e8713c3dde9221762911fe1217d 100644 (file)
@@ -5,14 +5,19 @@
 date=`date +%y%m%d`
 ##### date=`expr $date - 1` # files are postdated by 1 day
 
-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.0 $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
+cd /moira/ || exit 1
+for who in  staff student ; do
+  if  [ -f tapes/$who.input.$date.Z ] ; then
+    [ -s $who.input ] \
+    && mv $who.input.0 $who.input.1 \
+    && mv $who.input   $who.input.0
+
+    zcat tapes/$who.input.$date.Z | bin/$who.cvt > $who.input
+
+    [ -s $who.input ] \
+    && [ `diff $who.input.0 $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
+  fi
 done
This page took 0.03011 seconds and 4 git commands to generate.