Lets see if we can make this better for outlook.
authorRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Sun, 4 Nov 2012 16:42:34 +0000 (08:42 -0800)
committerRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Sun, 4 Nov 2012 16:42:43 +0000 (08:42 -0800)
marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh [new file with mode: 0755]

diff --git a/marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh b/marc_export_custom/sitka-full-export-parallel-outlook-wrapper.sh
new file mode 100755 (executable)
index 0000000..0e3d372
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+# This is meant to be fire-and-forget
+# Only use it if you trust the output!
+export DIR=`dirname $0`
+[ -z "${T}" ] && export T=$(date -u +%Y%m%dT%H%M%SZ)
+[ -z "${OUTDIR}" ] && export OUTDIR=$(mktemp --tmpdir -d outlook_export.XXXXXXX)
+cd $OUTDIR
+$DIR/fetch-shortcodes.sh
+cd $DIR
+time ./sitka-full-export-parallel.sh
+cd $OUTDIR
+mkdir split
+mv *split* split/
+pbzip2 -9nvk -p4 *{marc,log}
+pbzip2 -9nv -p4 split/*{marc,log}
+$DIR/stats.sh
+cp $DIR/email-template.sh $OUTDIR/
+cat >lftp.cmd <<EOF
+open ftp://ftpbcuc:bcv15c@ftp.auto-graphics.com/
+mkdir -p sitka/$T
+cd sitka/$T
+mput *csv *stats
+mput *bz2
+rels -l
+EOF
+lftp -f lftp.cmd
+chmod +x email-template.sh
+./email-tempate.sh "$T" "@$(date +%s)"