From: Robin H. Johnson Date: Sat, 18 Jul 2015 21:03:24 +0000 (-0700) Subject: Refactor export scripts and take my email address off them. X-Git-Url: https://git.sitka.bclibraries.ca/gitweb/?p=sitka%2Fsitka-tools.git;a=commitdiff_plain;h=d10c96dc783d0993cb226eb2bf27b85daa53f589 Refactor export scripts and take my email address off them. Signed-off-by: Robin H. Johnson --- diff --git a/marc_export_custom/email-template-ebsco.sh b/marc_export_custom/email-template-ebsco.sh index 3956814..abde63e 100755 --- a/marc_export_custom/email-template-ebsco.sh +++ b/marc_export_custom/email-template-ebsco.sh @@ -12,10 +12,10 @@ fi cat < +From: "SITKA sysop" Subject: UCN EBSCO export $(date +%Y/%m/%d -d "$t1") notification To: "Daniel Mertens" , "Kathy Ellerton" , "Jessica Carmody" -Cc: "Robin H. Johnson" , "Sharon Herbert" +Cc: "SITKA sysop" , "Sharon Herbert" Full automated UCN EBSCO export diff --git a/marc_export_custom/email-template-outlook.sh b/marc_export_custom/email-template-outlook.sh index 418f35f..fd3d5f6 100755 --- a/marc_export_custom/email-template-outlook.sh +++ b/marc_export_custom/email-template-outlook.sh @@ -13,10 +13,10 @@ fi # illsupport@bclibrary.ca goes to Mari.Martin@gov.bc.ca and Bob.Yuan@gov.bc.ca cat < +From: "SITKA sysop" Subject: SITKA Outlook export $(date +%Y/%m/%d -d "$t1") (includes ELN media/serials) To: "BC Public Libraries" , "Sunni Nishimura" , "Ramiro Castillo" -Cc: "Robin H. Johnson" , "Sharon Herbert" +Cc: "SITKA sysop" , "Sharon Herbert" Full automated Outlook export diff --git a/marc_export_custom/mucn-full-export-parallel-ebsco-wrapper.sh b/marc_export_custom/mucn-full-export-parallel-ebsco-wrapper.sh index 01789f8..5c0a9d6 100755 --- a/marc_export_custom/mucn-full-export-parallel-ebsco-wrapper.sh +++ b/marc_export_custom/mucn-full-export-parallel-ebsco-wrapper.sh @@ -2,6 +2,7 @@ # This is meant to be fire-and-forget # Only use it if you trust the output! export DIR=$(readlink -f $(dirname $0)) +NAME=ebsco if [ -z "${MAKEOPTS}" ]; then echo "MAKEOPTS env variable is not set" echo "If you really want this to be serialized, export MAKEOPTS=-j1" @@ -9,14 +10,15 @@ if [ -z "${MAKEOPTS}" ]; then exit 1 fi [ -z "${T}" ] && export T=$(date -u +%Y%m%dT%H%M%SZ) -[ -z "${OUTDIR}" ] && export OUTDIR=$(mktemp --tmpdir -d ebsco_export.$T.XXXXXXX) +[ -z "${OUTDIR}" ] && export OUTDIR=$(mktemp --tmpdir -d ${NAME}_export.$T.XXXXXXX) cd $OUTDIR echo Prep $(date -uR)/@$(date +%s) $DIR/fetch-shortcodes.sh cd $DIR echo Exporting $(date -uR)/@$(date +%s) export PERLOPT=-X -time ./mucn-ebsco-full-export-parallel.sh +time ./mucn-${NAME}-full-export-parallel.sh >script.log 2>&1 +rc=$? cd $OUTDIR mkdir split mv *split* split/ @@ -24,7 +26,7 @@ echo Compressing $(date -uR)/@$(date +%s) pbzip2 -9nk -p4 *{marc,log} pbzip2 -9n -p4 split/*{marc,log} echo Stats $(date -uR)/@$(date +%s) -DELETE=0 $DIR/stats.sh +DELETE=0 $DIR/stats.sh >stats.log 2>&1 # Look for zeros in the output marc echo Sanity $(date -uR)/@$(date +%s) egrep -vsq '^([[:space:]]*0){2}.*marc$' *stats @@ -39,9 +41,11 @@ echo FTP $(date -uR)/@$(date +%s) # Two passes with mget, so the stats and csv are always there first # they are small and serve to show we might be uploading more, and they have # checksums so AutoGraphics can check the upload +# EBSCO wants the raw .marc, they do not support any compression +FTPSITE=ftp://cat00975a:neJUJ4ez@ftp.epnet.com/ FTPDIR=full/mucn/$T cat >lftp.cmd <email.txt -/usr/lib/sendmail -t -f rjohnson@sitka.bclibraries.ca email.txt +/usr/lib/sendmail -t -f sysop@bc.libraries.coop script.log 2>&1 rc=$? cd $OUTDIR mkdir split @@ -25,9 +26,9 @@ echo Compressing $(date -uR)/@$(date +%s) pbzip2 -9nk -p4 *{marc,log} pbzip2 -9n -p4 split/*{marc,log} echo Stats $(date -uR)/@$(date +%s) -$DIR/stats.sh -echo Sanity $(date -uR)/@$(date +%s) +DELETE=1 $DIR/stats.sh >stats.log 2>&1 # Look for zeros in the output marc +echo Sanity $(date -uR)/@$(date +%s) egrep -vsq '^([[:space:]]*0){2}.*marc$' *stats grep_result=$? # halt if found @@ -40,17 +41,19 @@ echo FTP $(date -uR)/@$(date +%s) # Two passes with mget, so the stats and csv are always there first # they are small and serve to show we might be uploading more, and they have # checksums so AutoGraphics can check the upload +FTPSITE=ftp://ftpbcuc:bcv15c@ftp.auto-graphics.com/ +FTPDIR=sitka/$T cat >lftp.cmd <email.txt -/usr/lib/sendmail -t -f rjohnson@sitka.bclibraries.ca email.txt +/usr/lib/sendmail -t -f sysop@bc.libraries.coop