From 55318b371caca91704b0c1cf7a3422fa2cd5840c Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Mon, 3 Dec 2012 05:18:53 +0000 Subject: [PATCH] Error checking and paths. --- marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh b/marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh index e54c18a..bb88281 100755 --- a/marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh +++ b/marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh @@ -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