mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-10 12:26:10 +08:00
feat: Add function backups by default for MySQL and MariaDB databases. (#7823)
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after 1s
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after 1s
This commit is contained in:
parent
67aa8471dc
commit
afa8cf22b1
2 changed files with 2 additions and 2 deletions
|
|
@ -234,7 +234,7 @@ func (r *Local) Backup(info BackupInfo) error {
|
|||
dumpCmd = "mariadb-dump"
|
||||
}
|
||||
global.LOG.Infof("start to %s | gzip > %s.gzip", dumpCmd, info.TargetDir+"/"+info.FileName)
|
||||
cmd := exec.Command("docker", "exec", r.ContainerName, dumpCmd, "-uroot", "-p"+r.Password, "--default-character-set="+info.Format, info.Name)
|
||||
cmd := exec.Command("docker", "exec", r.ContainerName, dumpCmd, "--routines", "-uroot", "-p"+r.Password, "--default-character-set="+info.Format, info.Name)
|
||||
var stderr bytes.Buffer
|
||||
cmd.Stderr = &stderr
|
||||
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ func (r *Remote) Backup(info BackupInfo) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
backupCmd := fmt.Sprintf("docker run --rm --net=host -i %s /bin/bash -c '%s -h %s -P %d -u%s -p%s %s --default-character-set=%s %s'",
|
||||
backupCmd := fmt.Sprintf("docker run --rm --net=host -i %s /bin/bash -c '%s --routines -h %s -P %d -u%s -p%s %s --default-character-set=%s %s'",
|
||||
image, dumpCmd, r.Address, r.Port, r.User, r.Password, sslSkip(info.Version, r.Type), info.Format, info.Name)
|
||||
|
||||
global.LOG.Debug(strings.ReplaceAll(backupCmd, r.Password, "******"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue