2 # This is meant to be fire-and-forget
3 # Only use it if you trust the output!
4 export DIR=$(readlink -f $(dirname $0))
5 if [ -z "${MAKEOPTS}" ]; then
6 echo "MAKEOPTS env variable is not set"
7 echo "If you really want this to be serialized, export MAKEOPTS=-j1"
8 echo "Otherwise set it about 1.5x your number of CPUs!"
11 [ -z "${T}" ] && export T=$(date -u +%Y%m%dT%H%M%SZ)
12 [ -z "${OUTDIR}" ] && export OUTDIR=$(mktemp --tmpdir -d outlook_export.$T.XXXXXXX)
14 $DIR/fetch-shortcodes.sh
17 time ./sitka-full-export-parallel.sh
22 pbzip2 -9nvk -p4 *{marc,log}
23 pbzip2 -9nv -p4 split/*{marc,log}
25 # Look for zeros in the output marc
26 egrep -vsq '^([[:space:]]*0){2}.*marc$' *stats
29 if [ $rc -ne 0 -o $grep_result -ne 0 ]; then
30 echo "Failed to run export! Human needed! export=$rc grep_sanity=$grep_result" 1>&2
34 cp $DIR/email-template-outlook.sh $OUTDIR/
36 open ftp://ftpbcuc:bcv15c@ftp.auto-graphics.com/
44 chmod +x email-template-outlook.sh
45 ./email-template-outlook.sh "$T" "@$(date +%s)" >email.txt
46 /usr/lib/sendmail -f rjohnson@sitka.bclibraries.ca <email.txt