Skip to content

Commit

Permalink
Anpassungen zur Automatisierung HAN-Upload.
Browse files Browse the repository at this point in the history
  • Loading branch information
Basil (lokal) committed May 29, 2017
1 parent 9efcc8e commit c6ae847
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 13 deletions.
1 change: 1 addition & 0 deletions han_transformations.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAIL_EDV='basil.marti@unibas.ch'
11 changes: 11 additions & 0 deletions han_transformations_infomail.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Liebe Kolleginnen und Kollegen

Die HAN-Daten aus dsv05 wurden soeben erfolgreich aufbereitet und nach Swissbib exportiert.
Die Daten werden in Swissbib in der naechsten Nacht verarbeitet und sind am Folgetag ab Mittag in
Swissbib und Swissbib Basel Bern recherchierbar.

Herzlich

Basil Marti


4 changes: 4 additions & 0 deletions log/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
2 changes: 1 addition & 1 deletion raw.hanmarc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
!.gitignore
42 changes: 30 additions & 12 deletions workflow.HAN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,46 @@

# Script that controls the main workflow

basedir=$PWD
source ./han_transformations.conf

DO_DOWNLOAD=1
DO_CATMANDU=1
DO_XSLT=1
DO_FINISH=1

DO_DOWNLOAD=0
DO_CATMANDU=0
DO_XSLT=0
DO_FINISH=0
DO_UPLOAD=0
DO_EMAIL=1

DATE=`date +%Y%m%d`
BASEDIR=$PWD
LOG=$PWD/log/han_transformations_$DATE.log
INFOMAIL=$PWD/han_transformations_infomail.txt

if [ "$DO_DOWNLOAD" == "1" ]; then
echo "Downloading Aleph-Sequential"
$basedir/download.dsv05.sequential.sh
mv $basedir/dsv05.seq $basedir/raw.hanseq/
echo "Downloading Aleph-Sequential" >> $LOG
#$BASEDIR/download.dsv05.sequential.sh
#mv $BASEDIR/dsv05.seq $BASEDIR/raw.hanseq/
cp /opt/data/dsv05/dsv05.seq $BASEDIR/raw.hanseq/
fi

if [ "$DO_CATMANDU" == "1" ]; then
echo "Transforming Aleph-Sequential into HAN-Marc"
perl transform.seq2hanmarc.pl $basedir/raw.hanseq/dsv05.seq $basedir/raw.hanmarc/gruen.xml $basedir/raw.hanmarc/orange.xml
echo "Transforming Aleph-Sequential into HAN-Marc" >> $LOG
perl transform.seq2hanmarc.pl $BASEDIR/raw.hanseq/dsv05.seq $BASEDIR/raw.hanmarc/gruen.xml $BASEDIR/raw.hanmarc/orange.xml
fi

if [ "$DO_XSLT" == "1" ]; then
$basedir/transform.han2sbmarc.sh $basedir HAN
$BASEDIR/transform.han2sbmarc.sh $BASEDIR HAN >> $LOG
fi

if [ "$DO_FINISH" == "1" ]; then
$basedir/transform.into.1.line.sh $basedir
$BASEDIR/transform.into.1.line.sh $BASEDIR >> $LOG
fi

if [ "$DO_UPLOAD" == "1" ]; then
echo "Uploading files to swissbib-Server" >> $LOG
fi

if [ "$DO_EMAIL" == "1" ]; then
cat $LOG | mailx -a "From:basil.marti@unibas.ch" -s "Logfile: HAN-Daten fuer swissbib vom $DATE generiert" $MAIL_EDV
cat $INFOMAIL | mailx -a "From:basil.marti@unibas.ch" -s "Infomail: HAN-Daten fuer swissbib vom $DATE generiert" $MAIL_EDV
fi

0 comments on commit c6ae847

Please sign in to comment.