My ssh connection is unreliable, so I've been studiously using screen and detaching every time I start a long-running process. The screen part I know is necessary, but is the detaching as well? Thanks.
You do not have to disconnect, if the connection gets interrupted you can use
screen -dr to reattach to a already running screen session that wasn't properly disconnected from first.
Simply list out the screen sessions using
$ screen -ls There is a screen on: 10266.somesession (Attached) 1 Socket in /var/run/screen/S-slm.
Note the sessions name,
10266.somesession and reattach to it like so:
$ screen -dr 10266.somesession
NOTE: So long as the other system where
screen is running is not rebooted or the parent process that owns
screen is not killed, your screen sessions will remain intact.