Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ __You should consider the [use of `--env-file=`](https://docs.docker.com/engine/
* `DB_DUMP_INCLUDE`: names of databases to restore separated by spaces. Required if `SINGLE_DATABASE=true`.
* `SINGLE_DATABASE`: If is set to `true`, `DB_DUMP_INCLUDE` is required and must contain exactly one database name. Mysql command will then run with `--database=$DB_DUMP_INCLUDE` flag. This avoids the need of `USE <database>;` statement, which is useful when restoring from a file saved with `SINGLE_DATABASE` set to `true`.
* `DB_RESTORE_TARGET`: path to the actual restore file, which should be a compressed dump file. The target can be an absolute path, which should be volume mounted, an smb or S3 URL, similar to the target.
* `DB_DUMP_DEBUG`: if `true`, dump copious outputs to the container logs while restoring.
* `DB_DEBUG`: if `true`, dump copious outputs to the container logs while restoring.
* To use the S3 driver `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_DEFAULT_REGION` will need to be defined.

Examples:
Expand Down
16 changes: 8 additions & 8 deletions pkg/core/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ func (e *Executor) Dump(ctx context.Context, opts DumpOptions) (DumpResults, err
func preBackup(ctx context.Context, timestamp, dumpfile, dumpdir, preBackupDir string, debug bool) error {
// construct any additional environment
env := map[string]string{
"NOW": timestamp,
"DUMPFILE": dumpfile,
"DUMPDIR": dumpdir,
"DB_DUMP_DEBUG": fmt.Sprintf("%v", debug),
"NOW": timestamp,
"DUMPFILE": dumpfile,
"DUMPDIR": dumpdir,
"DB_DEBUG": fmt.Sprintf("%v", debug),
}
ctx, span := util.GetTracerFromContext(ctx).Start(ctx, "pre-backup")
defer span.End()
Expand All @@ -200,10 +200,10 @@ func preBackup(ctx context.Context, timestamp, dumpfile, dumpdir, preBackupDir s
func postBackup(ctx context.Context, timestamp, dumpfile, dumpdir, postBackupDir string, debug bool) error {
// construct any additional environment
env := map[string]string{
"NOW": timestamp,
"DUMPFILE": dumpfile,
"DUMPDIR": dumpdir,
"DB_DUMP_DEBUG": fmt.Sprintf("%v", debug),
"NOW": timestamp,
"DUMPFILE": dumpfile,
"DUMPDIR": dumpdir,
"DB_DEBUG": fmt.Sprintf("%v", debug),
}
ctx, span := util.GetTracerFromContext(ctx).Start(ctx, "post-backup")
defer span.End()
Expand Down
2 changes: 1 addition & 1 deletion scripts.d/post-backup/rename_backup.sh.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# Rename backup file.
if [[ -n "$DB_DUMP_DEBUG" ]]; then
if [[ -n "$DB_DEBUG" ]]; then
set -x
fi

Expand Down