From c95051cd73884cc5f339aa6a5162b164c7cc09db Mon Sep 17 00:00:00 2001 From: Ashkan Date: Sat, 12 Sep 2020 15:14:52 +0430 Subject: [PATCH] [db-backup] Update README.md --- README.md | 9 ++++++++- main.go | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e5d4cce..ad925e0 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ You can see usage with --help flag | p | output file path | | | f | output file type (sql,zip,gz) | sql | | d | add date to output file | false | +| i | input file path | | | db_user | database user name | | | db_pass | database user password | | | db_host | database host | | @@ -28,6 +29,12 @@ gobackup -f gz -config /laravel/.env -n out ``` This command will create a file named `out` and `out.gz` by dumping all tables with connection info of `.env` file +### Import Command +You can also import a sql file with any of these mime-types (`sql`,`gz`,`zip`): +```bash +gobackup -i path/to/file.sql -config /laravel/.env +``` + ### Build Executable From Source You May build the executable file with following command : ```bash @@ -37,4 +44,4 @@ go build -ldflags="-s -w" ### Contribution :love_letter: -Fork project and send PR to me :heart: \ No newline at end of file +Fork project and send PR to me :heart: diff --git a/main.go b/main.go index e5a93dc..7a69e02 100644 --- a/main.go +++ b/main.go @@ -112,7 +112,7 @@ func parseFlags() { flag.StringVar(&filePath, "p", "", "output file path") flag.StringVar(&fileType, "f", "sql", "output file type (sql|zip|gz)") flag.BoolVar(&includeDate, "d", false, "add date to output files") - flag.StringVar(&importFile, "i", "", "import file path") + flag.StringVar(&importFile, "i", "", "input file path") flag.StringVar(&dbUsername, "db_user", "", "database user name") flag.StringVar(&dbPassword, "db_pass", "", "database user password")