Files
sysPass/tests/res/scripts/dump_to_xml.sh
Rubén D 0fbaccf8a1 * [MOD] Improved plugins handling by moving items' data to new database table.
* [MOD] Added plugins upgrade process

Signed-off-by: Rubén D <nuxsmin@syspass.org>
2019-01-22 01:18:03 +01:00

24 lines
502 B
Bash
Executable File

#!/bin/bash
DB_HOST=$(docker inspect syspass-db-test --format {{.NetworkSettings.Networks.bridge.IPAddress}})
if [ -z "${DB_HOST}" ]; then
echo "Unknown host"
exit 1
fi
DB_TABLE=$1
DUMP_PATH=$2
if [ -z ${DB_TABLE} ]; then
echo "Table not set"
exit 1
fi
if [ -z ${DUMP_PATH} ]; then
echo "Dump path not set"
exit 1
fi
mysqldump --hex-blob -t -u root --password=syspass-test --host=${DB_HOST} --xml syspass-test `echo "${DB_TABLE^}"` >> ${DUMP_PATH}/syspass_${DB_TABLE}.xml