Skip to content

Commit 5b48e34

Browse files
committed
Signal traefik process to rotate logs
1 parent f79dc33 commit 5b48e34

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

import.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ if [ -f "$ROTATED_LOG_FILE" ]; then
88
echo "Log rotation successful. Processing the rotated log file."
99
# Call the import script
1010
python3 /app/import_logs.py --dry-run "$ROTATED_LOG_FILE" --url "$MATOMO_URL" --token-auth "$API_TOKEN"
11+
12+
# Find the PID of the traefik process
13+
TRAEFIK_PID=$(pgrep traefik)
14+
15+
# Check if the PID was found
16+
if [ -n "$TRAEFIK_PID" ]; then
17+
# Send USR1 signal to the traefik process
18+
kill -USR1 "$TRAEFIK_PID"
19+
echo "Sent USR1 signal to traefik process with PID $TRAEFIK_PID"
20+
else
21+
echo "Traefik process not found."
22+
exit 1
23+
fi
1124
else
1225
echo "Rotated log file not found."
1326
exit 1

0 commit comments

Comments
 (0)