func RunTakeBackupCommand(cfg *Config, name string) error {
	xtrabackup := exec.Command(xtrabackupCommand, cfg.XtrabackupArgs()...)
	var err error
	xcloud := exec.Command(xcloudCommand, cfg.XCloudArgs()...)
	log.Info("xargs ", "xargs", strings.Join(cfg.XCloudArgs(), " "))
	if xcloud.Stdin, err = xtrabackup.StdoutPipe(); err != nil {
		log.Error(err, "failed to pipline")
		return err
	}
	xtrabackup.Stderr = os.Stderr
	xcloud.Stderr = os.Stderr
	if err := xtrabackup.Start(); err != nil {
		log.Error(err, "failed to start xtrabackup command")
		return err
	}
	if err := xcloud.Start(); err != nil {
		log.Error(err, "fail start xcloud ")
		return err
	}
	errorChannel := make(chan error, 2)
	go func() {
		errorChannel <- xcloud.Wait()
	}()
	go func() {
		errorChannel <- xtrabackup.Wait()
	}()
	for i := 0; i < 2; i++ {
		if err = <-errorChannel; err != nil {
			return err
		}
	}
	return nil
}
RunTakeBackupCommand starts a backup command
package sidecar
import (
	"os"
	"os/exec"
	"strings"
)