From 283d55b27a2d996e72fdd5f6dcadeb34e421411d Mon Sep 17 00:00:00 2001 From: xc Date: Thu, 23 Oct 2025 16:07:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=88=90=E5=8A=9F=E5=90=8E?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scagent/util/fsutil.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/scagent/util/fsutil.go b/scagent/util/fsutil.go index 6c6e9d2..7dc1519 100644 --- a/scagent/util/fsutil.go +++ b/scagent/util/fsutil.go @@ -14,7 +14,6 @@ import ( "path/filepath" "scagent/config" "strings" - "time" "github.com/schollz/progressbar/v3" "go.uber.org/zap" @@ -304,16 +303,6 @@ func DecompressZip(zpFname string, dirpath string) error { return fmt.Errorf("failed to open file in zip (%v)", err) } defer fileInArchive.Close() - // 检查文件是否存在,存在的话先备份 - if _, err := os.Stat(filePath); err == nil { - // 当前时间 - currentTime := time.Now().Format("20060102_150405") - // 备份文件 - backupPath := filePath + currentTime + "_bak" - if err := os.Rename(filePath, backupPath); err != nil { - return fmt.Errorf("failed to backup file (%v)", err) - } - } // 复制文件到目标路径 if _, err := io.Copy(dstFile, fileInArchive); err != nil { return fmt.Errorf("failed to copy file in zip (%v)", err)