I'm accessing Ubuntu Server from a putty terminal and then I run this test.sh
script from that terminal:
$ bash test.sh &
(note the &)
#!/bin/bash
while true
do
node myscript.js
wait $!
sleep 5
done
Which is supposed to keep that node script running "forever". The issue is that when I close the SSH session/remote terminal (Putty) the script is also terminated.
How do I keep that script running after closing that SSH session?
screen
ortmux
. You'll love it ;-) – Rinzwind Apr 22 '21 at 11:43disown
ornohup
(https://askubuntu.com/a/8672/158442, https://askubuntu.com/a/222855/158442, other answers too) – muru Apr 22 '21 at 12:08