| 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 | # illsupport@bclibrary.ca goes to Mari.Martin@gov.bc.ca and Bob.Yuan@gov.bc.ca |
| 14 | cat <<EOF |
| 15 | Date: $(date -uR) |
| 16 | From: "Robin H. Johnson" <rjohnson@sitka.bclibraries.ca> |
| 17 | Subject: SITKA Outlook export $(date +%Y/%m/%d -d "$t1") (includes ELN media/serials) |
| 18 | To: "BC Public Libraries" <illsupport@bclibrary.ca>, "Sunni Nishimura" <sunnin@eln.bc.ca>, "Ramiro Castillo" <rcr@auto-graphics.com> |
| 19 | Cc: "Robin H. Johnson" <rjohnson@sitka.bclibraries.ca>, "Sharon Herbert" <sherbert@sitka.bclibraries.ca> |
| 20 | |
| 21 | Full automated Outlook export |
| 22 | |
| 23 | Please remember to review the shortcodes*csv file for any new shortcodes. |
| 24 | |
| 25 | Notes: |
| 26 | (none, this was automated) |
| 27 | |
| 28 | Directory for uploads: |
| 29 | sitka/$T |
| 30 | |
| 31 | Submission timestamp: |
| 32 | $(date -uR -d "$t2") |
| 33 | |
| 34 | Generation timestamp: |
| 35 | $(date -uR -d "$t1") |
| 36 | |
| 37 | Submission method: |
| 38 | FTP |
| 39 | |
| 40 | Compressed sizes in bytes: |
| 41 | $(head -n2 *stats | awk '/.marc.bz2$/{print $9,$5}') |
| 42 | |
| 43 | Uncompressed size in bytes: |
| 44 | $(head -n2 *stats | awk '/.marc$/{print $9,$5}') |
| 45 | $(find -name '*.csv' -printf '%f %s\n') |
| 46 | |
| 47 | Number of records submitted: |
| 48 | $(grep -h Filename -A5 $i *stats | awk '/.marc$/{print $3,$1}') |
| 49 | |
| 50 | SHA1 checksums: |
| 51 | $(egrep '^[a-f0-9]{32}' *stats -h |sort -k +2) |
| 52 | $(sha1sum *.csv) |
| 53 | EOF |