This is not a happy situation to begin with, but what if you have to? Someone has to do the dirty job. In order for you to not have your laptop connected to the production environment for 10 hours just to run a job, you need:
So, for our specific purpose, to keep it short:
screento enter the screen.
- Do the long-running dirty job that you need to do.
- Close the ssh. This will force your job to go into “detached” mode. Aka, it’s running in the background now. Don’t use
exitto close it, though, or you’ll close your
screen, and by extension, end your job.
- After 10 hours, ssh back into production, and use
screen -lsto list all the screens that are in the background.
screen -r 41565(number will be listed after running the above command) to enter the hidden screen.
- If you don’t like numbers, you can also give your
screena name with
screen -S fancy-nameand use this name to re-attach back to it.
- If you are confused about all the “closing” of windows, you can also explicitly detach your
ctrl + Athen press