Just improving the friend’s response @Igor-Cavalcanti.
If you just run with >> log.txt &
does not guarantee that it will continue running in the background after you terminate your session at the terminal, it will only direct the STOUT to the file log.txt
, and will be active until you terminate your session. When you close the terminal, the process is also terminated.
The right thing to do in this case, to run in the background - even after the session is over - would be to use nohup
According to the Wikipedia:
nohup is a UNIX command that allows you to run a program in a form
"disconnected" from the current session. That is, if the user logs out, the
command will continue to run in the background, issuing its output to the
file nohup.out
That is, even if you disconnect from the terminal, your command will continue running on the server, which I believe is the reason you want it.
So the final command would be:
nohup waitress-serve --call --listen=0.0.0.0:5000 app:create_app &
Note that there is no >> log.txt
once the nohup
will save the output in the file nohup.out