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