From c9ee6f74bdc01f86c0701cb71e4bb75414ba592f Mon Sep 17 00:00:00 2001 From: Manuel Reul Date: Thu, 5 Oct 2023 11:07:02 +0000 Subject: [PATCH] Update testserver.sh --- testserver.sh | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/testserver.sh b/testserver.sh index cb2bc46..3bcae3e 100755 --- a/testserver.sh +++ b/testserver.sh @@ -1 +1,30 @@ -touch /tmp/x.txt +#! /bin/bash +#touch /tmp/x.txt + +# Check if programm LogRotate exists +if command -v logrotate >/dev/null; + then + echo "Program Logrotate exists. Continue..." +else + echo "Program Lognotate doen not exist. Start installation..." + apt-get install -y logrotate +fi + +if [ ! -f /etc/logrotate.d/odoo ]; + then + echo "Config-file for logrotation Odoo not found!" + + #create config-file for Odoo Logrotation + cat < /etc/logrotate.d/odoo + /var/log/odoo/*.log { + daily + missingok + rotate 7 + compress + notifempty + } +EOF + echo "Created Odoo logrotation succesfully." +else + echo "Odoo logrotation allready exists." +fi