From 7c600a357c62fff8216bbe612986f63b76b2166b Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Fri, 9 Jun 2023 11:42:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=A4=87=E4=BB=BD=E6=88=96=E5=8D=87=E7=BA=A7=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#1306)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/backup_app.go | 2 +- backend/app/service/cronjob_helper.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/service/backup_app.go b/backend/app/service/backup_app.go index c8ef87ce9..f6cf42c06 100644 --- a/backend/app/service/backup_app.go +++ b/backend/app/service/backup_app.go @@ -99,7 +99,7 @@ func handleAppBackup(install *model.AppInstall, backupDir, fileName string) erro return err } - appPath := fmt.Sprintf("%s/%s", install.GetPath(), install.Name) + appPath := install.GetPath() if err := handleTar(appPath, tmpDir, "app.tar.gz", ""); err != nil { return err } diff --git a/backend/app/service/cronjob_helper.go b/backend/app/service/cronjob_helper.go index ce2cc7ac3..17e28429b 100644 --- a/backend/app/service/cronjob_helper.go +++ b/backend/app/service/cronjob_helper.go @@ -196,7 +196,7 @@ func handleTar(sourceDir, targetDir, name, exclusionRules string) error { path := "" if strings.Contains(sourceDir, "/") { itemDir := strings.ReplaceAll(sourceDir[strings.LastIndex(sourceDir, "/"):], "/", "") - aheadDir := strings.ReplaceAll(sourceDir, itemDir, "") + aheadDir := sourceDir[:strings.LastIndex(sourceDir, "/")] path += fmt.Sprintf("-C %s %s", aheadDir, itemDir) } else { path = sourceDir