wip
Just 4 fun
- Dump the database with the time of creation of the file in the title
- Separates table creation files and data insertion files
- Execute SQL data from files
- Ignores the dump tables specified in the config
- Uses
.env
file to set up environment
$ ./dmpr
$ ./dmpr -import path/to/file.sql
For create exemple .env file
$ ./dmpr -make-env
.env param | required | example | description |
---|---|---|---|
TITLE | true | example.com | |
DB_HOST | true | mysql | |
DB_PORT | true | 3306 | |
DB_DATABASE | true | homestead | |
DB_USERNAME | true | homestead | |
DB_PASSWORD | true | secret | |
DUMP_CREATE | true | true | create tables file |
DUMP_INSERT | true | true | insert data file |
DUMP_DIR | false | dumps | Folder for dump |
IGNORE_TABLES | false | peoples|likes | if you want to ignore some tables, specify them with the symbol | |
DEBUG | false | false | for debugging the file names do not contain the creation date |
LOG | false | true | Create a file logging errors |
LOG_ERROR_FILE | false | error.log | filename error log |
$ ./dmpr -make-env # create .env file
$ ./dmpr -all # Ignore .env parameters DUMP_CREATE and DUMP_INSERT
$ ./dmpr -import path/to/file.sql # Execute sql file
$ ./dmpr -help
Usage of ./dmpr:
-all
create all dump files
-import string
import dump file
-make-env
create .env boilerplate file
$ tree .
.
├── dmpr
└── dumps
└── 2018-12-27
└── 2018-12-27_03:57_insert.sql