From aeef39727b297a1465ed6154d0c4c5a4c707d49d Mon Sep 17 00:00:00 2001 From: Cannon Lock Date: Wed, 2 Oct 2024 12:45:48 -0500 Subject: [PATCH] Run it for real --- Dockerfile | 2 +- import.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8ea1bcf..b23fc85 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,4 +25,4 @@ RUN crontab /etc/cron.d/import-cron RUN touch /var/log/cron.log # Start the cron service and the application -CMD printenv > /etc/environment && cron && tail -f /var/log/cron.log \ No newline at end of file +CMD printenv > /etc/environment && cron && tail -f /var/log/cron.log diff --git a/import.sh b/import.sh index eb651b8..5720573 100644 --- a/import.sh +++ b/import.sh @@ -1,5 +1,7 @@ #!/bin/sh +# This file is run on successful log rotation + # Define the log file and the rotated log file ROTATED_LOG_FILE="$LOG_PATH.1" @@ -7,7 +9,7 @@ ROTATED_LOG_FILE="$LOG_PATH.1" if [ -f "$ROTATED_LOG_FILE" ]; then echo "Log rotation successful. Processing the rotated log file." # Call the import script - python3 /app/import_logs.py --dry-run "$ROTATED_LOG_FILE" --url "$MATOMO_URL" --token-auth "$API_TOKEN" + python3 /app/import_logs.py "$ROTATED_LOG_FILE" --url "$MATOMO_URL" --token-auth "$API_TOKEN" # Find the PID of the traefik process TRAEFIK_PID=$(pgrep traefik)