Skip to content

Commit

Permalink
Run it for real
Browse files Browse the repository at this point in the history
  • Loading branch information
CannonLock committed Oct 2, 2024
1 parent 5b48e34 commit aeef397
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
CMD printenv > /etc/environment && cron && tail -f /var/log/cron.log
4 changes: 3 additions & 1 deletion import.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/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"

# Check if the rotated log file exists
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)
Expand Down

0 comments on commit aeef397

Please sign in to comment.