Skip to content

Commit

Permalink
feat: ability to disable gzip #14
Browse files Browse the repository at this point in the history
  • Loading branch information
maxisam committed Sep 16, 2022
1 parent e33913d commit d8b6959
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/backup/utils.go
Expand Up @@ -22,7 +22,10 @@ func BuildRestoreCmd(archive string, target config.Target, restore config.Target

// command: mongodump | mongorestore
func buildCmd(command string, archive string, target config.Target, overrideDBName string) string {
cmd := fmt.Sprintf("%v --archive=%v --gzip ", command, archive)
cmd := fmt.Sprintf("%v --archive=%v ", command, archive)
if !target.NoGzip {
cmd += "--gzip "
}
// using uri (New in version 3.4.6)
// host/port/username/password are incompatible with uri
// https://docs.mongodb.com/manual/reference/program/mongodump/#cmdoption-mongodump-uri
Expand Down
1 change: 1 addition & 0 deletions pkg/config/plan.go
Expand Up @@ -38,6 +38,7 @@ type Target struct {
Password string `yaml:"password"`
Port int `yaml:"port"`
Username string `yaml:"username"`
NoGzip bool `yaml:"noGzip"`
Params string `yaml:"params"`
}

Expand Down

0 comments on commit d8b6959

Please sign in to comment.