problem: I created an EC2 machine, and I want to start some long running script, and I want the script to keep running even after I close my terminal session.

solution: A friend introduced me to "screen". I type "screen", which opens a sort of virtual terminal, and I run my command within that, and then I press Ctrl-A and then D to "detach" from the session but keep it running. I can reattach with the command "screen -R". Apparently it is just the nature of screen itself to keep running even if I close my terminal session, so I can "exit", log in again, type "screen -R" and I'm back to the command I ran, and I can even see all its output.

No comments:

Post a Comment