a214f691a67afd9cb30f95d12890e1437e2da7ca
[sitka/sitka-tools.git] / marc_export_custom / email-template-outlook.sh
1 #!/bin/bash
2 t1=$1
3 t1=${t1/T/ }
4 t1=${t1/??Z}
5 t2=$2
6 t2=${t2/T/ }
7 t2=${t2/??Z}
8
9 if [ -z "$t1" -o -z "$t2" ]; then
10         echo "Usage: $0 'Generate timestamp' 'Submit timestamp'" 1>&2
11 fi
12
13 FILELIST=`cat Manifest`
14
15 # illsupport@bclibrary.ca goes to Mari.Martin@gov.bc.ca and Bob.Yuan@gov.bc.ca
16 cat <<EOF
17 Date: $(date -uR)
18 From: "SITKA Tier 2 Support" <sitka-tier2@bc.libraries.coop>
19 Subject: SITKA Outlook export $(date +%Y/%m/%d -d "$t1") (includes ELN media/serials)
20 To: "BC Public Libraries" <illsupport@bclibrary.ca>, "OutLook Online Support" <olol_support@eln.bc.ca>, "Ramiro Castillo" <rcr@auto-graphics.com>
21 Cc: "SITKA Tier 2 Support" <sitka-tier2@bc.libraries.coop>, "Sharon Herbert" <sherbert@sitka.bclibraries.ca>
22
23 Full automated Outlook export
24
25 Please remember to review the shortcodes*csv file for any new shortcodes.
26
27 Notes:
28 (none, this was automated)
29
30 Directory for uploads:
31 sitka/
32
33 Submission timestamp:
34 $(date -uR -d "$t2")
35
36 Generation timestamp:
37 $(date -uR -d "$t1")
38
39 Submission method:
40 WebDAV
41
42 Compressed sizes in bytes:
43 $(head -n2 *stats | awk '/.marc.bz2$/{print $9,$5}')
44
45 Uncompressed size in bytes:
46 $(head -n2 *stats | awk '/.marc$/{print $9,$5}')
47 $(find -name '*.csv' -printf '%f %s\n')
48
49 Number of records submitted:
50 $(grep -h Filename -A5 $i *stats | awk '/.marc$/{print $3,$1}')
51
52 Files uploaded:
53 $FILELIST
54
55 SHA1 checksums:
56 $(egrep '^[a-f0-9]{32}' *stats -h |sort -k +2)
57 $(sha1sum *.csv)
58 EOF