-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkflow.HAN.sh
executable file
·47 lines (38 loc) · 1.74 KB
/
workflow.HAN.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Script that controls the main workflow
BASEDIR=/opt/scripts/HANTransformations/
source $BASEDIR/han_transformations.conf
DO_DOWNLOAD=1
DO_CATMANDU=1
DO_XSLT=1
DO_FINISH=1
DO_UPLOAD=1
DO_EMAIL=1
DATE=`date +%Y%m%d`
LOG=$BASEDIR/log/han_transformations_$DATE.log
INFOMAIL=$BASEDIR/han_transformations_infomail.txt
if [ "$DO_DOWNLOAD" == "1" ]; then
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/ &>> $LOG
fi
if [ "$DO_CATMANDU" == "1" ]; then
echo "Transforming Aleph-Sequential into HAN-Marc" >> $LOG
perl $BASEDIR/transform.seq2hanmarc.pl $BASEDIR/raw.hanseq/dsv05.seq $BASEDIR/raw.hanmarc/gruen.xml $BASEDIR/raw.hanmarc/orange.xml >> $LOG
fi
if [ "$DO_XSLT" == "1" ]; then
$BASEDIR/transform.han2sbmarc.sh $BASEDIR HAN &>> $LOG
fi
if [ "$DO_FINISH" == "1" ]; then
$BASEDIR/transform.into.1.line.sh $BASEDIR &>> $LOG
fi
if [ "$DO_UPLOAD" == "1" ]; then
echo "Uploading files to swissbib-Server" >> $LOG
scp $BASEDIR/out.swissbib-MARC-1line/gruen_marcxml.format.xml [email protected]:/swissbib_index/solrDocumentProcessing/FrequentInitialPreProcessing/data/format_archivaldata/ &>> $LOG
scp $BASEDIR/out.swissbib-MARC-1line/orange_marcxml.format.xml [email protected]:/swissbib_index/solrDocumentProcessing/FrequentInitialPreProcessing/data/format_archivaldata/ &>> $LOG
fi
if [ "$DO_EMAIL" == "1" ]; then
cat $LOG | mailx -a "From:[email protected]" -s "Logfile: HAN-Daten fuer swissbib vom $DATE generiert" $MAIL_EDV
cat $INFOMAIL | mailx -a "From:[email protected]" -s "Infomail: HAN-Daten fuer swissbib vom $DATE generiert" $MAIL_HAN
fi