Commit 2f779c25 authored by ueli heuer's avatar ueli heuer 👾
Browse files

Add host and dbname as cmdline paramater

parent b839f16b
#!/bin/bash
#
# $Id$
# Copyright (c) Ueli Heuer
#
# (c) 2004 by ueli@dvgtool.org
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
database="$1"
host="$2"
user="$3"
passwd="$4"
user=$1
passwd=$2
ssl_mode='DISABLED'
if [ "$passwd" != "" ]; then
if [ "${passwd}" != "" ]; then
mysqldump --skip-ssl -u$user -p$passwd \
--databases dvgdb \
mysqldump --ssl-mode=${ssl_mode} --host="${host}" --user="${user}" --password="${passwd}" \
--databases ${database} \
--add-drop-table \
--no-data > tables_without_values.sql
mysqldump --skip-ssl -u$user -p$passwd \
--databases dvgdb \
mysqldump --ssl-mode=${ssl_mode} --host="${host}" --user="${user}" --password="${passwd}" \
--databases ${database} \
--add-drop-table --complete-insert \
--tables dvg_device_speed \
graph \
graph_param \
graph_time \
graph_uses \
dvg_graph \
dvg_graph_param \
dvg_graph_time \
dvg_graph_uses \
dvg_probe \
dvg_probe_args \
dvg_probe_param \
......@@ -34,5 +50,5 @@ if [ "$passwd" != "" ]; then
dvg_help_text \
dvg_sysObjectID > tables_with_values.sql
else
echo "usage $0 username password"
echo "usage $0 database username password"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment