From fce9d18efb8829fb515441043b92ed93d051326a Mon Sep 17 00:00:00 2001 From: JungJun Date: Thu, 18 Aug 2022 18:31:47 +0900 Subject: [PATCH] =?UTF-8?q?rotate=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- icslog/icslog.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/icslog/icslog.go b/icslog/icslog.go index c1bdfbc..e095b1e 100644 --- a/icslog/icslog.go +++ b/icslog/icslog.go @@ -123,7 +123,15 @@ func NewIcsLog(conf *icsconf.LogConfig, level int, output int, path string, disk // gIcsLog.logger = log.New(&gIcsLog.buf, "", log.Ldate|log.Ltime|log.Lmicroseconds|log.Lshortfile) gIcsLog.logger = log.New(&gIcsLog.buf, "", 0) - gIcsLog.CurrentDate = time.Now() + // 5분 연산 + now := time.Now() + nowMin := now.Minute() + nowMinRem := nowMin % 5 + nowMinS := fmt.Sprintf("%02dm", nowMinRem) + convMinutes, _ := time.ParseDuration(nowMinS) + diffMinutes := now.Add(-convMinutes) + + gIcsLog.CurrentDate = diffMinutes gIcsLog.DelDay = conf.DelConfig.DelDay gIcsLog.DelHour = conf.DelConfig.DelHour