From 4fae4630aa6e70eea8e2a8094ba401e9b5956b63 Mon Sep 17 00:00:00 2001 From: Ridwan Naibi Suleiman Date: Mon, 8 Jun 2026 16:52:56 +0100 Subject: [PATCH] install_moodle.sh: rotate site logs to prevent disk exhaustion --- scripts/install_moodle.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/install_moodle.sh b/scripts/install_moodle.sh index f1b8176d..ddffe775 100644 --- a/scripts/install_moodle.sh +++ b/scripts/install_moodle.sh @@ -818,6 +818,20 @@ local1.* /var/log/sitelogs/moodle/access.log local1.err /var/log/sitelogs/moodle/error.log local2.* /var/log/sitelogs/moodle/cron.log EOF + + # Rotate the site logs so they don't grow unbounded and fill the OS disk + cat < /etc/logrotate.d/moodle-sitelogs +/var/log/sitelogs/moodle/*.log { + daily + rotate 14 + missingok + notifempty + compress + delaycompress + copytruncate +} +EOF + service rsyslog restart # Fire off moodle setup