Scripts to help with template email and upload.
[sitka/sitka-tools.git] / marc_export_custom / email-template.sh
CommitLineData
8ec81273
RJ
1#!/bin/bash
2t1=$1
3t1=${t1/T/ }
4t1=${t1/??Z}
5t2=$2
6t2=${t2/T/ }
7t2=${t2/??Z}
8
9if [ -z "$t1" -o -z "$t2" ]; then
10 echo "Usage: $0 'Generate timestamp' 'Submit timestamp'" 1>&2
11fi
12
13cat <<EOF
14Date: $(date -uR)
15From: "Robin H. Johnson" <rjohnson@sitka.bclibraries.ca>
16Subject: SITKA Outlook export $(date +%Y/%m/%d -d "$t1") (includes ELN media/serials)
17To: Anne Morgan <anne.morgan@bclibrary.ca>, Ramiro Castillo <rcr@auto-graphics.com>, Heather Morrison <heatherm@eln.bc.ca>
18Cc: "Robin H. Johnson" <rjohnson@sitka.bclibraries.ca>, Ben Hyman <ben.hyman@cooperative.bclibraries.ca>, sherbert@sitka.bclibraries.ca
19
20Full automated Outlook export
21
22Notes:
23Apologies about the delay, I went and worked on a lot of bugs.
24After the Autographics code generate the next set of FAILEDFILTER and REJECT
25entries are generated (James & Mark fixed entries for me back in December), I'm
26going to start feeding most of those into an exclusion list so we can flag them
27for further fixing while not sending them to Autographics until then.
28These exports are smaller than the previous round by a good 10%, of records
29that were weird or shouldn't have been in the export in the first place (like
30SPRUCE holdings).
31Anne: The full list of SITKA shortcodes, including the branch suffixes you
32requested, is in the .csv file included in the upload. We can add a column
33later for the Outlook shortcodes where they aren't the same as the SITKA
34shortcodes.
35
36Directory for uploads:
37sitka/
38
39Submission timestamp:
40$(date -uR -d "$t2")
41
42Generation timestamp:
43$(date -uR -d "$t1")
44
45Submission method:
46FTP
47
48Compressed sizes in bytes:
49$(head -n2 *stats | awk '/.marc.bz2$/{print $9,$5}')
50
51Uncompressed size in bytes:
52$(head -n2 *stats | awk '/.marc$/{print $9,$5}')
53$(find -name '*.csv' -printf '%f %s\n')
54
55Number of records submitted:
56$(grep -h Filename -A5 $i *stats | awk '/.marc$/{print $3,$1}')
57
58SHA1 checksums:
59$(egrep '^[a-f0-9]{32}' *stats -h |sort -k +2)
60$(sha1sum *.csv)
61EOF