]> matita.cs.unibo.it Git - helm.git/commitdiff
added utility to dump some tables of the db on mowgli
authorEnrico Tassi <enrico.tassi@inria.fr>
Thu, 16 Jun 2005 09:25:50 +0000 (09:25 +0000)
committerEnrico Tassi <enrico.tassi@inria.fr>
Thu, 16 Jun 2005 09:25:50 +0000 (09:25 +0000)
(useful to export metadata to laptops)

helm/ocaml/metadata/dump_db/dump.sh [new file with mode: 0755]

diff --git a/helm/ocaml/metadata/dump_db/dump.sh b/helm/ocaml/metadata/dump_db/dump.sh
new file mode 100755 (executable)
index 0000000..e7b4366
--- /dev/null
@@ -0,0 +1,20 @@
+ALL_TABLES=`../table_creator/table_creator list all`
+
+if [ -z "$1" ]; then
+  echo "Dumps to stdout some tables of a given db on mowgli."
+  echo "If no tables are given the dump will contain:"
+  echo "  $ALL_TABLES"
+  echo ""
+  echo "usage: dump.sh dbname [tables...]"
+  echo ""
+  exit 1
+fi
+DB=$1
+shift
+if [ -z "$1" ]; then
+  TABLES=$ALL_TABLES
+else
+  TABLES=$@
+fi
+
+mysqldump -e --add-drop-table -u helm -h mowgli.cs.unibo.it $DB $TABLES