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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 235 - (show annotations)
Mon Feb 25 12:58:41 2008 UTC (17 years ago) by torsten
File MIME type: application/x-sh
File size: 763 byte(s)
Added scripts to automate the export

1 #!/bin/sh
2
3 DBHOST=laodameia
4 DBPORT=5434
5 EXPORTHOST=${DBHOST}
6 EXPORTUSER=anonupload
7 SSHKEY=/etc/ssh/waskaservice/id_rsa
8 DATADIR=/tmp
9 UPLOADDIR=incoming
10
11 # Get a list of all db
12 DBLIST=`sudo -u postgres getDbList.sh`
13 # For each db export cases as anonymized xml
14 DATE=`date +"%Y-%m-%d"`
15 for DB in ${DBLIST}
16 do
17 EXPORTFILE=${DATADIR}/${DB}_${DATE}.xml
18 sudo -u postgres xmlexport.py ${DB} "${DBHOST}" "${DBPORT}" > $EXPORTFILE
19 if [ "$?" -eq "0" ]; then
20 gzip -f -9 ${EXPORTFILE}
21 echo "Sende Datei ${EXPORTFILE}.gz"
22 scp -i ${SSHKEY} \
23 -o "StrictHostKeyChecking=no" \
24 -o "UserKnownHostsFile=/dev/null" \
25 ${EXPORTFILE}.gz ${EXPORTUSER}@${EXPORTHOST}:${UPLOADDIR}
26 fi
27 rm -f ${EXPORTFILE} ${EXPORTFILE}.gz
28 done

Properties

Name Value
svn:executable *

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26