Error checking and paths.
authorRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Mon, 3 Dec 2012 05:18:53 +0000 (05:18 +0000)
committerRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Mon, 3 Dec 2012 05:18:53 +0000 (05:18 +0000)
marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh

index e54c18a..bb88281 100755 (executable)
@@ -2,6 +2,12 @@
 # This is meant to be fire-and-forget
 # Only use it if you trust the output!
 export DIR=$(readlink -f $(dirname $0))
+if [ -z "${MAKEOPTS}" ]; then
+       echo "MAKEOPTS env variable is not set"
+       echo "If you really want this to be serialized, export MAKEOPTS=-j1"
+       echo "Otherwise set it about 1.5x your number of CPUs!"
+       exit 1
+fi
 [ -z "${T}" ] && export T=$(date -u +%Y%m%dT%H%M%SZ)
 [ -z "${OUTDIR}" ] && export OUTDIR=$(mktemp --tmpdir -d outlook_export.XXXXXXX)
 cd $OUTDIR
@@ -26,4 +32,4 @@ EOF
 lftp -f lftp.cmd
 chmod +x email-template.sh
 ./email-template.sh "$T" "@$(date +%s)" >email.txt
-sendmail <email.txt
+/usr/lib/sendmail <email.txt