From 62becf819da2718397156495c73c52a70b45ffec Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Sun, 25 Jun 2023 21:14:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=A4=87=E4=BB=BD=E6=A0=B9=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=B8=8B=E6=96=87=E4=BB=B6=E5=A4=B9=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#1444)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/cronjob_helper.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/app/service/cronjob_helper.go b/backend/app/service/cronjob_helper.go index 922d5b3d2..7c31894a1 100644 --- a/backend/app/service/cronjob_helper.go +++ b/backend/app/service/cronjob_helper.go @@ -203,6 +203,9 @@ func handleTar(sourceDir, targetDir, name, exclusionRules string) error { if strings.Contains(sourceDir, "/") { itemDir := strings.ReplaceAll(sourceDir[strings.LastIndex(sourceDir, "/"):], "/", "") aheadDir := sourceDir[:strings.LastIndex(sourceDir, "/")] + if len(aheadDir) == 0 { + aheadDir = "/" + } path += fmt.Sprintf("-C %s %s", aheadDir, itemDir) } else { path = sourceDir