3 # sync metadata from a source database (usually "mowgli") to a target one
5 # Created: Fri, 13 May 2005 13:50:16 +0200 zacchiro
6 # Last-Modified: Fri, 13 May 2005 13:50:16 +0200 zacchiro
10 MYSQL_FLAGS="-u helm -h localhost"
12 MYSQL="mysql $MYSQL_FLAGS -f"
13 MYSQLDUMP="mysqldump $MYSQL_FLAGS"
14 MYSQLRESTORE="mysqlrestore $MYSQL_FLAGS"
15 TABLES=`./table_creator list all`
16 DUMP="${SOURCE_DB}_dump.gz"
18 echo "Dumping source db $SOURCE_DB ..."
19 $MYSQLDUMP $SOURCE_DB $TABLES | gzip -c > $DUMP
20 echo "Destroying old tables in target db $TARGET_DB ..."
21 ./table_destructor table all | $MYSQL $TARGET_DB
22 echo "Creating table structure in target db $TARGET_DB ..."
23 echo "Filling target db $TARGET_DB ..."
24 zcat $DUMP | $MYSQL $TARGET_DB
25 ./table_creator index all | $MYSQL $TARGET_DB