Template help.
[sitka/sitka-tools.git] / marc_export_custom / email-template.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: "Robin H. Johnson" <rjohnson@sitka.bclibraries.ca>
16 Subject: SITKA Outlook export $(date +%Y/%m/%d -d "$t1") (includes ELN media/serials)
17 To: Anne Morgan <anne.morgan@bclibrary.ca>, Ramiro Castillo <rcr@auto-graphics.com>, Heather Morrison <heatherm@eln.bc.ca>
18 Cc: "Robin H. Johnson" <rjohnson@sitka.bclibraries.ca>, Ben Hyman <ben.hyman@cooperative.bclibraries.ca>, sherbert@sitka.bclibraries.ca
19
20 Full automated Outlook export
21
22 Notes:
23 ...
24
25 Directory for uploads:
26 sitka/$T
27
28 Submission timestamp:
29 $(date -uR -d "$t2")
30
31 Generation timestamp:
32 $(date -uR -d "$t1")
33
34 Submission method:
35 FTP
36
37 Compressed sizes in bytes:
38 $(head -n2 *stats | awk '/.marc.bz2$/{print $9,$5}')
39
40 Uncompressed size in bytes:
41 $(head -n2 *stats | awk '/.marc$/{print $9,$5}')
42 $(find -name '*.csv' -printf '%f %s\n')
43
44 Number of records submitted:
45 $(grep -h Filename -A5 $i *stats | awk '/.marc$/{print $3,$1}')
46
47 SHA1 checksums:
48 $(egrep '^[a-f0-9]{32}' *stats -h |sort -k +2)
49 $(sha1sum *.csv)
50 EOF