Fix grep fail.
authorRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Sat, 2 Aug 2014 17:02:27 +0000 (10:02 -0700)
committerRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Sat, 2 Aug 2014 17:02:27 +0000 (10:02 -0700)
Signed-off-by: Robin H. Johnson <rjohnson@sitka.bclibraries.ca>
marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh

index 63b32d9..f26cbb4 100755 (executable)
@@ -22,10 +22,12 @@ mv *split* split/
 pbzip2 -9nvk -p4 *{marc,log}
 pbzip2 -9nv -p4 split/*{marc,log}
 $DIR/stats.sh
-egrep -sq '^([[:space:]]*0){2}' *stats
+# Look for zeros in the output marc
+egrep -vsq '^([[:space:]]*0){2}.*marc$' *stats
 grep_result=$?
+# halt if found
 if [ $rc -ne 0 -o $grep_result -ne 0 ]; then
-       echo "Failed to run export! Human needed! export=$rc grep=$rc" 1>&2
+       echo "Failed to run export! Human needed! export=$rc grep_sanity=$grep_result" 1>&2
        cat *stats 1>&2
        exit 1
 fi