diff --git a/features/cm/license.go b/features/cm/license.go index 94857ec0..30b2e1f1 100644 --- a/features/cm/license.go +++ b/features/cm/license.go @@ -273,13 +273,13 @@ func UploadLicenseFileData(w http.ResponseWriter, r *http.Request) { } // backup system.ini to system.ini.bak sshHost := fmt.Sprintf("%s@%s", config.GetYamlConfig().NE.User, neInfo.Ip) - cpCmd := fmt.Sprintf("sudo test -f %s/system.ini && cp -f %s/system.ini %s/system.ini.bak", + cpCmd := fmt.Sprintf("sudo test -f %s/system.ini && cp -f %s/system.ini %s/system.ini.bak||echo 0", neLicensePath, neLicensePath, neLicensePath) cmd = exec.Command("ssh", sshHost, cpCmd) out, err = cmd.CombinedOutput() log.Debugf("Exec output: %v", string(out)) if err != nil { - log.Error("Faile to execute cp command:", err) + log.Errorf("Faile to execute cp command:%v, cmd:%s", err, cpCmd) services.ResponseInternalServerError500ProcessError(w, err) return }