Directory Structure [step 1]: moving files

working on #672

NOTE: This commit can't be compiled!!
This commit is contained in:
Yehonal
2017-10-12 20:00:52 +02:00
parent 4df28fd29c
commit f06f32849f
2508 changed files with 0 additions and 1325 deletions

1
apps/db_exporter/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
config.sh

View File

@@ -0,0 +1,12 @@
This script is used by devs to export the databases to base directories
You should use it on clean databases
## USAGE
NOTE: this script is only working under unix currently
1) You must create a config.sh file changing DB connection configurations
of /conf/config.sh.dist
2) Run the db_export.sh script and wait

View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
ROOTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd )"
source $ROOTPATH"/bin/bash_shared/includes.sh"
if [ -f "./config.sh" ]; then
source "./config.sh" # should overwrite previous
fi
echo "===== STARTING PROCESS ====="
function export() {
echo "Working on: "$1
database=$1
var_base_path="DB_"$database"_PATHS"
base_path=${!var_base_path}
base_conf="TPATH="$base_path";\
CLEANFOLDER=1; \
CHMODE=0; \
TEXTDUMPS=0; \
PARSEDUMP=1; \
FULL=0; \
DUMPOPTS='--skip-comments --skip-set-charset --routines --extended-insert --order-by-primary --single-transaction --quick'; \
"
var_base_conf="DB_"$database"_CONF"
base_conf=$base_conf${!var_base_conf}
var_base_name="DB_"$database"_NAME"
base_name=${!var_base_name}
bash $AC_PATH_MODULES"/drassil/mysql-tools/mysql-tools" dump "" $base_name "" "$base_conf"
}
for db in ${DATABASES[@]}
do
export "$db"
done
echo "===== DONE ====="