Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.
This repository was archived by the owner on May 28, 2021. It is now read-only.

Backups should not be written to disk temporarily #147

Open
@prydie

Description

@prydie

Currently, the mysqldump backup provider writes the backup to the local filesystem and then opens the file and returns that as the io.Reader for the object storage client.

f, err := os.Create(tmpFile)
if err != nil {
return nil, "", err
}
defer f.Close()
zw := gzip.NewWriter(f)
defer zw.Close()
cmd.SetStdout(zw)
glog.V(4).Infof("running cmd: '%v'", cmd)
err = cmd.Run()
if err != nil {
return nil, "", err
}
content, err := os.Open(tmpFile)
if err != nil {
return nil, "", err
}
return content, filepath.Base(tmpFile), nil

We should upload directly to object storage without writing to disk.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions