I want to launch a program on a remote server (Amazon AWS), but the calculation takes about 50h. So I would like to launch my program, switch off my computer then come back to see the results once finished.
I did the following command:
screen
ssh -i ubuntu@ip-address
python2 my_code.pyand then I pressed Ctrl+A, Ctrl+D to detach.
After that, I switch off my computer. When I switch it on and run
screen -r I get the following
There is no screen to be resumed. 1 Answer
If you switched off your laptop, then that screen process has terminated. You should run screen on the AWS instance:
ssh ubuntu@ip
# Then
screen
python ...Ultimately, screen should run on whichever system is likely to remain running. If that's your laptop, then run screen on the laptop. If that's the AWS instance, then run it on the AWS instance.