Commit | Line | Data |
---|---|---|
e404bb37 RJ |
1 | #!/bin/bash |
2 | # This is meant to be fire-and-forget | |
3 | # Only use it if you trust the output! | |
e38e56a8 | 4 | export DIR=$(readlink -f $(dirname $0)) |
55318b37 RJ |
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!" | |
9 | exit 1 | |
10 | fi | |
e404bb37 RJ |
11 | [ -z "${T}" ] && export T=$(date -u +%Y%m%dT%H%M%SZ) |
12 | [ -z "${OUTDIR}" ] && export OUTDIR=$(mktemp --tmpdir -d outlook_export.XXXXXXX) | |
13 | cd $OUTDIR | |
14 | $DIR/fetch-shortcodes.sh | |
15 | cd $DIR | |
16 | time ./sitka-full-export-parallel.sh | |
17 | cd $OUTDIR | |
18 | mkdir split | |
19 | mv *split* split/ | |
20 | pbzip2 -9nvk -p4 *{marc,log} | |
21 | pbzip2 -9nv -p4 split/*{marc,log} | |
22 | $DIR/stats.sh | |
23 | cp $DIR/email-template.sh $OUTDIR/ | |
24 | cat >lftp.cmd <<EOF | |
25 | open ftp://ftpbcuc:bcv15c@ftp.auto-graphics.com/ | |
26 | mkdir -p sitka/$T | |
27 | cd sitka/$T | |
28 | mput *csv *stats | |
29 | mput *bz2 | |
30 | rels -l | |
31 | EOF | |
32 | lftp -f lftp.cmd | |
33 | chmod +x email-template.sh | |
e8e2109c | 34 | ./email-template.sh "$T" "@$(date +%s)" >email.txt |
55318b37 | 35 | /usr/lib/sendmail <email.txt |