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:
parent
e37387b68f
commit
4eaad008e1
31
cycle.sh
Normal file
31
cycle.sh
Normal 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."
|
Loading…
x
Reference in New Issue
Block a user