|
|
|
@ -17,24 +17,24 @@ func main() {
|
|
|
|
|
cmd := exec.Command("/bin/bash", "-c", command)
|
|
|
|
|
|
|
|
|
|
//1、执行Shell进行备份数据库
|
|
|
|
|
//fmt.Println("1、正在备份数据库,请稍等...")
|
|
|
|
|
//command = `/usr/local/dsBackup/BackupMysqlFullDataBase.sh`
|
|
|
|
|
//cmd = exec.Command("/bin/bash", "-c", command)
|
|
|
|
|
//output, err := cmd.Output()
|
|
|
|
|
//if err != nil {
|
|
|
|
|
// log.Println(err)
|
|
|
|
|
//}
|
|
|
|
|
//resp := string(output)
|
|
|
|
|
//log.Println(resp)
|
|
|
|
|
fmt.Println("1、正在备份数据库,请稍等...")
|
|
|
|
|
command = `/usr/local/dsBackup/BackupMysqlFullDataBase.sh`
|
|
|
|
|
cmd = exec.Command("/bin/bash", "-c", command)
|
|
|
|
|
output, err := cmd.Output()
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Println(err)
|
|
|
|
|
}
|
|
|
|
|
resp := string(output)
|
|
|
|
|
log.Println(resp)
|
|
|
|
|
|
|
|
|
|
//2、备份程序目录
|
|
|
|
|
command = `/usr/local/dsMin/dsBackup/BackupApplication.sh`
|
|
|
|
|
cmd = exec.Command("/bin/bash", "-c", command)
|
|
|
|
|
output, err := cmd.Output()
|
|
|
|
|
output, err = cmd.Output()
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Println(err)
|
|
|
|
|
}
|
|
|
|
|
resp := string(output)
|
|
|
|
|
resp = string(output)
|
|
|
|
|
log.Println(resp)
|
|
|
|
|
//3、上传数据库备份到云存储
|
|
|
|
|
fmt.Println("1、正在将备份文件上传到云存储...")
|
|
|
|
|