From a9f927238837354c55619d9af418cfe218758ba5 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Thu, 21 Sep 2023 18:45:54 +0200 Subject: [PATCH] #4149 add copytruncate to logrotate config --- build_sdcard.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build_sdcard.sh b/build_sdcard.sh index 4b7afbdca..c8fce9a49 100644 --- a/build_sdcard.sh +++ b/build_sdcard.sh @@ -507,6 +507,9 @@ echo "# Optimizing log files: rotate daily max 100M, keep 4 days & compress old" sed -i "s/^weekly/daily size 100M/g" /etc/logrotate.conf sed -i "s/^#compress/compress/g" /etc/logrotate.conf +# add the option "copytruncate" to /etc/logrotate.conf below the line staring with "# global options do" +sed -i '/# global options do/a \copytruncate' /etc/logrotate.conf + # SPECIAL FOR SYSLOG: /etc/logrotate.d/rsyslog # to test config run: sudo logrotate -v /etc/logrotate.d/rsyslog rm /etc/logrotate.d/rsyslog 2>/dev/null @@ -530,6 +533,7 @@ echo " missingok compress delaycompress + copytruncate sharedscripts postrotate service logrotate restart