GNU bug report logs -
#54659
[PATCH 0/2] Periodically delete build logs
Previous Next
Reported by: Ludovic Courtès <ludo <at> gnu.org>
Date: Thu, 31 Mar 2022 21:21:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
* gnu/services/base.scm (%base-services): Add 'log-cleanup-service-type'
instance.
* doc/guix.texi (Log Rotation): Add example and mention '%base-services'.
---
doc/guix.texi | 13 ++++++++++++-
gnu/services/base.scm | 6 ++++++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index ad2763ec8a..eaaf829aa2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17645,7 +17645,18 @@ Some log files just need to be deleted periodically once they are old,
without any other criterion and without any archival step. This is the
case of build logs stored by @command{guix-daemon} under
@file{/var/log/guix/drvs} (@pxref{Invoking guix-daemon}). The
-@code{log-cleanup} service addresses this use case.
+@code{log-cleanup} service addresses this use case. For example,
+@code{%base-services} (@pxref{Base Services}) includes the following:
+
+@lisp
+;; Periodically delete build logs more than 4 months old.
+(service log-cleanup-service-type
+ (log-cleanup-configuration
+ (directory "/var/log/guix/drvs")
+ (expiry (* 4 30 24 3600))))
+@end lisp
+
+That ensures build logs do not accumulate endlessly.
@defvr {Scheme Variable} log-cleanup-service-type
This is the type of the service to delete old logs. Its value must be a
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index f278cb76de..ebaba524bc 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2817,6 +2817,12 @@ (define %base-services
(service rottlog-service-type)
+ ;; Periodically delete build logs more than 4 months old.
+ (service log-cleanup-service-type
+ (log-cleanup-configuration
+ (directory "/var/log/guix/drvs")
+ (expiry (* 4 30 24 3600))))
+
;; The LVM2 rules are needed as soon as LVM2 or the device-mapper is
;; used, so enable them by default. The FUSE and ALSA rules are
;; less critical, but handy.
--
2.34.0
This bug report was last modified 3 years and 49 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.