Skip to content

Commit

Permalink
DB dump: fix path for anonymization script
Browse files Browse the repository at this point in the history
  • Loading branch information
dregad committed Jan 10, 2017
1 parent 25147aa commit da573a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion db-dump.sh
Expand Up @@ -65,6 +65,9 @@ DUMPFILE=$TARGETDIR/${DBNAME}_dump_$(date +"%Y%m%d").sql.bz2
# Temporary database clone
DBCLONE=${DBNAME}_clone_$RANDOM

# DB anonymization script
SQL_ANONYMIZE=$(dirname $0)/db-anonymize.sql

# Trap signals to ensure we drop the temporary clone database in case of
# unexpected interuption
trap "{
Expand All @@ -83,7 +86,7 @@ set -o pipefail
mysqldump --lock-tables $DBNAME |mysql $DBCLONE

echo "Clean up and anonymize the cloned database"
mysql -v $DBCLONE <db-anonymize.sql
mysql -v $DBCLONE <$SQL_ANONYMIZE

echo "Dumping '$DBCLONE' to '$TARGETDIR'"
mysqldump $DBNAME | bzip2 > $DUMPFILE
Expand Down

0 comments on commit da573a0

Please sign in to comment.