/[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 246 - (show annotations)
Mon Mar 3 10:22:35 2008 UTC (16 years, 11 months ago) by torsten
File MIME type: application/x-sh
File size: 803 byte(s)
Modified script to be used in the production environment.

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

Properties

Name Value
svn:executable *

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26