From aaf4f7dd5cc36c6d3a017fbca04ac88d88e04423 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 31 Oct 2021 11:23:48 +0100 Subject: [PATCH] script: add logrotate rule for webcam service (#127) --- scripts/install_mjpg-streamer.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/install_mjpg-streamer.sh b/scripts/install_mjpg-streamer.sh index f58e0c8..8035642 100755 --- a/scripts/install_mjpg-streamer.sh +++ b/scripts/install_mjpg-streamer.sh @@ -79,6 +79,25 @@ EOT ln -s "/var/log/webcamd.log" "${HOME}/klipper_logs/webcamd.log" fi + ### step 6.2: add webcamd.log logrotate + if [ ! -f "/etc/logrotate.d/webcamd" ]; then + status_msg "Create logrotate rule ..." + sudo /bin/sh -c "cat > /etc/logrotate.d/webcamd" << EOF +/var/log/webcamd.log +{ + rotate 4 + weekly + maxsize 64M + missingok + notifempty + compress + delaycompress + sharedscripts +} +EOF + ok_msg "Done!" + fi + ### confirm message CONFIRM_MSG="MJPG-Streamer has been set up!" print_msg && clear_msg