dbImportProfile
1. Help
Command: bin/dbImportProfile --help
SYNOPSIS:
Generate optimized profiles to be used by dbImport.
USAGE: dbImportProfile [OPTIONS] [ARGUMENTS]
USAGE: dbImportProfile [--ratio|-r <ratio>] [--profile|-p <profile>]
[--from-dsn|-f <dsn>] [--help|-h] [--config]
[--bash-framework-config <bash-framework-config>] [--verbose|-v] [-vv] [-vvv]
[--log-level <log-level>] [--log-file <log-file>]
[--display-level <display-level>] [--no-color] [--theme <theme>] [--version]
[--quiet|-q]
ARGUMENTS:
fromDbName {single} (mandatory) The name of the source/remote database.
PROFILE OPTIONS:
--ratio, -r <ratio> {single}
define the ratio to use (0 to 100% - default 70).
- 0 means profile will filter out all the tables.
- 100 means profile will keep all the tables.
Eg: 70 means that tables with size(table+index)
that are greater than 70% of the max table size
will be excluded.
Default value: 70
--profile, -p <profile> {single}
The name of the profile to use in order to
include or exclude tables.
SOURCE OPTIONS:
--from-dsn, -f <dsn> {single}
Target mysql server.
GLOBAL OPTIONS:
--help, -h {single}
Displays this command help
--config {single}
Displays configuration
--bash-framework-config <bash-framework-config> {single}
Use alternate bash framework configuration.
--verbose, -v {single}
Info level verbose mode (alias of --display-level INFO)
-vv {single}
Debug level verbose mode (alias of --display-level DEBUG)
-vvv {single}
Trace level verbose mode (alias of --display-level TRACE)
--log-level <log-level> {single}
Set log level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: OFF
--log-file <log-file> {single}
Set log file
Default value: /logs/bash.log
--display-level <display-level> {single}
Set display level
Possible values:
- OFF
- ERR
- ERROR
- WARN
- WARNING
- INFO
- DEBUG
- TRACE
Default value: INFO
--no-color {single}
Produce monochrome output. alias of --theme noColor.
--theme <theme> {single}
Choose color theme - default-force means colors will be produced even if
command is piped.
Possible values:
- default
- default-force
- noColor
Default value: default
--version {single}
Print version information and quit.
--quiet, -q {single}
Quiet mode, doesn't display any output.
DESCRIPTION:
Data Source Name (DSN)
Default dsn directory:
/bash/conf/dsn
User dsn directory:
/home/www-data/.bash-tools/dsn
Allows to override dsn defined in "Default dsn directory"
List of available dsn:
- default.local
- default.remote
- localhost-root
Profiles
Default profiles directory:
/bash/conf/dbImportProfiles
User profiles directory:
/home/www-data/.bash-tools/dbImportProfiles
Allows to override profiles defined in "Default profiles directory"
List of available profiles:
- all
- default
- none
VERSION: 3.0
AUTHOR: [François Chastanet](https://github.com/fchastanet)
SOURCE FILE: https://github.com/fchastanet/bash-tools-framework/tree/master/src/_binaries/Database/dbImportProfile/dbImportProfile-binary.yaml
LICENSE: MIT License
Copyright (c) 2021-now François Chastanet
2. Usage
Import remote db into local db
dbImportProfile --from-dsn default.local MY_DB --ratio 45
Ability to generate profile that can be used in dbImport to filter out tables bigger than given ratio (based on biggest
table size). Profile is automatically saved in ${HOME}/.bash-tools/dbImportProfiles with this format auto*<dsn>*<db>
eg: auto_default.local_MY_DB