Skip to content
Snippets Groups Projects
Commit b35fee4b authored by David Beniamine's avatar David Beniamine
Browse files

Merge branch 'services-desk-163-logrotate-traefik' into 'master'

add traefik logrotate

See merge request !23
parents 5f8b4f25 5cc9cfd4
No related branches found
No related tags found
1 merge request!23add traefik logrotate
......@@ -21,6 +21,22 @@ if [ -z "$(docker network ls | grep -w traefik)" ]; then
docker network create traefik --subnet 172.19.0.1/24
fi
# Logrotate traefik
cat <<EOF > /etc/logrotate.d/traefik
/home/dockerweb/traefik/log/access.log {
weekly
rotate ${LOGROTATE:-4}
compress
# Do not rotate if empty
notifempty
delaycompress
missingok
}
EOF
systemctl restart logrotate
mkdir -p /home/dockerweb/
# Ajout de la clé maintenance
......
......@@ -32,6 +32,9 @@ export EXTRAS_SERVICES_TO_RESTART="systemd-logind"
export DOLIBARR_DB="dolibarr"
export NEXTCLOUD_DATABASE_NAME="nextcloud"
# logrotate variables
# Week for logrotate, by default 4 week
export LOGROTATE=4
# Monit variables
# CPU and RAM overload time is in monit cycle. 1 cycle = 2 minutes
......
......@@ -21,6 +21,22 @@ if [ ! -e "$order_systemd_file" ]; then
fi
systemctl enable docker-order
# Logrotate traefik
cat <<EOF > /etc/logrotate.d/traefik
/home/dockerweb/traefik/log/access.log {
weekly
rotate ${LOGROTATE:-4}
compress
# Do not rotate if empty
notifempty
delaycompress
missingok
}
EOF
systemctl restart logrotate
# Services maintenance
cd /home/dockerweb
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment