/[formed]/trunk/tools/anonym/cron.importAnonXml.sh
ViewVC logotype

Contents of /trunk/tools/anonym/cron.importAnonXml.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 249 - (show annotations)
Mon Mar 3 13:54:32 2008 UTC (16 years, 11 months ago) by torsten
File MIME type: application/x-sh
File size: 557 byte(s)
Added deleting of old cases

1 #!/bin/sh
2
3 DATADIR=/upload/incoming
4 DBHOST=laodameia
5 DBNAME=ka_auswertung_db
6 DBUSER=ka_auswertung_adm
7 DBPORT=5432
8
9 cd ${DATADIR}
10 for XML in `ls *.xml.gz`
11 do
12 KA=`echo ${XML} | awk '{print $1}' FS="-"`
13 FKZ=`echo $KA | sed 's/ka_//g' | sed 's/_db//g'`
14 psql -U ${DBUSER} ${DBNAME} -c "DELETE FROM master_tbl WHERE fkz = '${FKZ}'"
15 echo "importing ${KA}"
16 zcat ${XML} | \
17 xmlimport.py \
18 --database=${DBNAME} \
19 --host=${DBHOST} \
20 --user=${DBUSER} \
21 --port=${DBPORT} \
22 --fkz=${FKZ}
23 rm -f ${XML}
24 done

Properties

Name Value
svn:executable *

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26