From 3120ecf2f5cb61011c321f6e41936e6a77c0686c Mon Sep 17 00:00:00 2001 From: Jon Lockwood Date: Fri, 18 Feb 2022 13:46:27 +0930 Subject: [PATCH] fix(logrotate): ensure log rotate runs Deleted the standard logrotate job from cron.daily and created a new cron job to force run logrotate at `00:01` MR !7 --- dockerfile | 3 ++- include/etc/cron.d/logrotate | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 include/etc/cron.d/logrotate diff --git a/dockerfile b/dockerfile index b0059d0..6229fc6 100644 --- a/dockerfile +++ b/dockerfile @@ -82,7 +82,8 @@ RUN apt update && DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends # Cleanup, remove cron jobs not required RUN rm -f /etc/cron.d/e2scrub_all \ && rm -f /etc/cron.daily/apt-compat \ - && rm -f /etc/cron.daily/dpkg + && rm -f /etc/cron.daily/dpkg \ + && rm -f /etc/cron.daily/logrotate COPY include/ / diff --git a/include/etc/cron.d/logrotate b/include/etc/cron.d/logrotate new file mode 100644 index 0000000..0282579 --- /dev/null +++ b/include/etc/cron.d/logrotate @@ -0,0 +1,6 @@ +# +# Run Log rotate +# +# m h dom mon dow user command +1 0 * * * root /usr/sbin/logrotate -f /etc/logrotate.conf >/dev/null +