screen -S sessionnameIn order to find the screen session later you might want to rename it using sessionname. Or on the first screen invocation use the s flag -S sessionname
I started the R software in this screen session, started a long running process. Then detached the session with:
CTRL-A-DI could re-attach the session later with:
screen -r sessionnameIf the session was not detached properly, it might be necessary to detach it and re attach it:
Screen detach before leaving the ssh session. You may want to use the autodetach configuration option.
screen -d -r sessionname
Log out of your ssh session. Log in back again later:
screen -ls # list sessions
screen -r sessionname # attach a session
There might be solutions to move an already started process to GNU screen but its not straightforward:
"You cannot do this, easily. I'd suggest making it a habit to start screen as the first thing you do after opening a console. However, for your actual problem, there's another thing you could try: after having launched your job from the terminal, background it by typing ctrl-z and then
bg. After that, detach the job from it's parent shell; in bash you'd do
disown -h %. After that, you can safely close the terminal and the job will continue running."
More tips in this discussion on screen.