Do long running bash scritps close themselves after a while? That is do they timeout? I have tried searching this seemingly simple question but can't seem to find the answer.
I am running a bash script over night in order to gather data but my script stops running by morning.
My scripts looks something like this:
#!/bin/bash
port="3000"
host="192.168.1.1"
(
for(( y=0; y<225; y++))
do
for(( x=0; x<79; x++ ))
do
sleep 3
echo "command1"
sleep 35
done
echo "command2"
sleep 300
done
) | telnet "${host}" "${port}" | tee -a -i outputFile
I'm not sure if the problem could be related to my output file either. Currently my output file has over 100 000 lines.
Any advice or direction would be much appreciated.
bash
is the wrong tool. You should useexpect
.(((35+3)×79)+300)×225=742,950
seconds and the for-loops are done.