2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

feat: 优化日志切割

This commit is contained in:
2025-05-16 08:38:37 +08:00
parent 855c8cfb51
commit 07ba6624bf

View File

@@ -144,7 +144,12 @@ func (r *backupRepo) CutoffLog(path, target string) error {
return err
}
return io.Remove(target)
// 原文件不能直接删除,直接删的话仍会占用空间直到重启相关的应用
if _, err := shell.Execf("cat /dev/null > '%s'", target); err != nil {
return err
}
return nil
}
// ClearExpired 清理过期备份