From 959edd8642e0cd4e50a6b639caecf8e7b3dec421 Mon Sep 17 00:00:00 2001 From: xc Date: Fri, 24 Oct 2025 15:06:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aufs/core/sendzip.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aufs/core/sendzip.go b/aufs/core/sendzip.go index 220f2c5..6591621 100644 --- a/aufs/core/sendzip.go +++ b/aufs/core/sendzip.go @@ -6,6 +6,7 @@ import ( "net/http" "net/rpc/jsonrpc" "os" + "path/filepath" "strings" "time" ) @@ -111,9 +112,9 @@ func SendZip(w http.ResponseWriter, r *http.Request) { // 自动升级的日志 func afsLog(zipblock ZipBlock) { - // 年月日格式文件夹 - year, month, day := time.Now().Date() - logdir := fmt.Sprintf("%v/%v/%v", year, month, day) + // 目录格式 2025/10 + logdir := fmt.Sprintf("%d/%02d", time.Now().Year(), time.Now().Month()) + logdir = filepath.Join("logs", logdir) // 日志文件 logfile := fmt.Sprintf("%v/aufs.log", logdir) // 检查目录是否存在