script: add logrotate rule for webcam service (#127)

This commit is contained in:
th33xitus
2021-10-31 11:23:48 +01:00
parent 26bac791aa
commit aaf4f7dd5c

View File

@@ -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