liquid_feedback_core

annotate lf_export @ 12:a67c1cd4facf

Version beta13

Function delete_private_data() deletes now all invite codes again, due to privacy reasons when using unencrypted channels for sending the invite codes
author jbe
date Sat Jan 02 12:00:00 2010 +0100 (2010-01-02)
parents 015825e225ca
children 2b03946cb0c2
rev   line source
jbe@8 1 #!/bin/sh
jbe@8 2
jbe@8 3 if [ -z "$1" -o -z "$2" ]; then
jbe@8 4 echo "Usage: $0 <dbname> <filename>.sql.gz"
jbe@8 5 exit 1
jbe@8 6 fi
jbe@8 7
jbe@8 8 EXPORT_DBNAME=liquid_feedback_autoexport
jbe@8 9 retval=0
jbe@8 10
jbe@8 11 echo "Dropping database \"$EXPORT_DBNAME\" if existent..."
jbe@8 12 dropdb "$EXPORT_DBNAME" 2> /dev/null
jbe@8 13 echo "Copying database \"$1\" to new database \"$EXPORT_DBNAME\"..."
jbe@8 14 if createdb -T "$1" "$EXPORT_DBNAME"
jbe@8 15 then
jbe@8 16 echo "Deleting private data in copied database..."
jbe@9 17 if psql -v ON_ERROR_STOP=1 -c 'SELECT delete_private_data()' "$EXPORT_DBNAME" > /dev/null
jbe@8 18 then
jbe@8 19 echo "Dumping and compressing copied database to \"$2\"..."
jbe@8 20 if pg_dump --no-owner --no-privileges "$EXPORT_DBNAME" | gzip -9 > "$2"
jbe@8 21 then
jbe@11 22 true
jbe@8 23 else
jbe@8 24 retval=4
jbe@8 25 fi
jbe@8 26 else
jbe@8 27 retval=3
jbe@8 28 fi
jbe@8 29 else
jbe@8 30 retval=2
jbe@8 31 fi
jbe@8 32 echo "Dropping database \"$EXPORT_DBNAME\"..."
jbe@8 33 dropdb "$EXPORT_DBNAME"
jbe@8 34 echo "DONE."
jbe@8 35 exit $retval

Impressum / About Us