added the monitor script cycle.sh. Made it check for the finish flag file. Added the finish flag generation to ingester.

This commit is contained in:
Никита Тырин 2024-09-12 11:50:23 +03:00
parent e37387b68f
commit 4eaad008e1

31
cycle.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/bash
# Function to run the command
run_command() {
python manage.py ingester &
PID=$!
echo "Started process with PID: $PID"
}
# Function to terminate the command
interrupt_command() {
kill -SIGINT $PID
echo "Interrupted process with PID: $PID"
}
# Run the command initially
run_command
# Loop to restart the command every 2 hours until ingester_done.flag is found
while [ ! -f ingester_done.flag ]; do
# Wait for 2 hours (7200 seconds)
sleep 7200
# Terminate the command
interrupt_command
# Restart the command
run_command
done
echo "ingester_done.flag found. Exiting script."