install-eg.sh: fix setup of non-prod Apache includes
[sitka/sitka-tools.git] / marc_export_custom / email-template-ebsco.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 cat <<EOF
14 Date: $(date -uR)
15 From: "SITKA sysop" <sysop@bc.libraries.coop>
16 Subject: UCN EBSCO export $(date +%Y/%m/%d -d "$t1") notification
17 To: "Daniel Mertens" <danielmertens@ebsco.com>, "Kathy Ellerton" <kellerton@ucn.ca>, "Jessica Carmody" <jcarmody@EBSCO.COM>
18 Cc: "SITKA sysop" <sysop@bc.libraries.coop>, "Sharon Herbert" <sherbert@sitka.bclibraries.ca>
19
20 Full automated UCN EBSCO export
21
22 Please remember to review the shortcodes*csv file for any new shortcodes.
23
24 Notes:
25 (none, this was automated)
26
27 Directory for uploads:
28 mucn/$T
29
30 Submission timestamp:
31 $(date -uR -d "$t2")
32
33 Generation timestamp:
34 $(date -uR -d "$t1")
35
36 Submission method:
37 FTP
38
39 Compressed sizes in bytes:
40 $(head -n2 *stats | awk '/.marc.bz2$/{print $9,$5}')
41
42 Uncompressed size in bytes:
43 $(head -n2 *stats | awk '/.marc$/{print $9,$5}')
44 $(find -name '*.csv' -printf '%f %s\n')
45
46 Number of records submitted:
47 $(grep -h Filename -A5 $i *stats | awk '/.marc$/{print $3,$1}')
48
49 SHA1 checksums:
50 $(egrep '^[a-f0-9]{32}' *stats -h |sort -k +2)
51 $(sha1sum *.csv)
52 EOF