From 6b3effc51ec25a1bf9a3723aaa31ec28b5534b5b Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Sat, 16 Sep 2023 20:19:41 +0800 Subject: [PATCH 1/2] d --- features/cm/ne.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/cm/ne.go b/features/cm/ne.go index a06c2cc6..4d99a282 100644 --- a/features/cm/ne.go +++ b/features/cm/ne.go @@ -427,7 +427,7 @@ func ExportCmFromNF(w http.ResponseWriter, r *http.Request) { } zipFile := fmt.Sprintf("%s-%s-etc-%s.zip", neTypeLower, strings.ToLower(neInfo.NeId), time.Now().Format(global.DateData)) - zipCmd := fmt.Sprintf("cd %s && zip -r %s etc/%s/*", config.GetYamlConfig().OMC.Backup, zipFile, neTypeLower) + zipCmd := fmt.Sprintf("cd %s/etc && zip -r %s %s/*", config.GetYamlConfig().OMC.Backup, zipFile, neTypeLower) command := fmt.Sprintf("%s&&%s", scpCmd, zipCmd) From 2715fd5be0cd3a5742bb5c6f3302ad5cf83521ab Mon Sep 17 00:00:00 2001 From: simonzhangsz Date: Sat, 16 Sep 2023 20:27:50 +0800 Subject: [PATCH 2/2] d --- features/cm/ne.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/cm/ne.go b/features/cm/ne.go index 4d99a282..d0b954ae 100644 --- a/features/cm/ne.go +++ b/features/cm/ne.go @@ -427,7 +427,8 @@ func ExportCmFromNF(w http.ResponseWriter, r *http.Request) { } zipFile := fmt.Sprintf("%s-%s-etc-%s.zip", neTypeLower, strings.ToLower(neInfo.NeId), time.Now().Format(global.DateData)) - zipCmd := fmt.Sprintf("cd %s/etc && zip -r %s %s/*", config.GetYamlConfig().OMC.Backup, zipFile, neTypeLower) + zipFilePath := config.GetYamlConfig().OMC.Backup + "/" + zipFile + zipCmd := fmt.Sprintf("cd %s/etc && zip -r %s %s/*", config.GetYamlConfig().OMC.Backup, zipFilePath, neTypeLower) command := fmt.Sprintf("%s&&%s", scpCmd, zipCmd) @@ -439,7 +440,6 @@ func ExportCmFromNF(w http.ResponseWriter, r *http.Request) { return } - zipFilePath := fmt.Sprintf("%s/%s", config.GetYamlConfig().OMC.Backup, zipFile) md5Sum, err := global.GetFileMD5Sum(zipFilePath) if err != nil { log.Error("Faile to md5sum:", err)