I use a bash script to download a large file from a client device into a web server.But since it will take a large amount of time, nginx will return gateway timeout. What i plan to do is pass the stdout of bash script to a python subprocess and send it as response. Since scp will not produce any output in stdout, I need to send some response every minute until scp command finishes. Is there any way to achieve this using bash script?Also I cannot increase Nginx timeout since it will usually take more than 20 minutes
How can I print some string until a command finishes?
bash;scp;nginx
You can spawn a process that does some output in the background and kill it once scp is done:(while sleep 60; do echo downloading; done) &PID=$!scp $1 $2kill $PID