I have this bash script that runs 2 python scripts in parallel, they bring data from another server via API, they work fine, but sometimes errors ocurrs when connection problems exists, and only fraction of the data is delivered
I want to make shure that if an error ocurrs the script start again, so I haved tried using until, but when I on purpose disconnect the internet to cause an error the script exits and doesnt start again.
can you help me with this?
!/bin/bash
scripts=/root/scripts
datos=/root/datos
fecha=$(date +"%Y_%m_%d")
until $scripts/filesystem.py > $datos/filesystem_$fecha.log &
do
echo error, retrying en 10 seconds
sleep 10
done
until $scripts/cpu.py > $datos/cpu_$fecha.log &
do
echo error, retrying en 10 seconds
sleep 10
done
wait