Glam Prestige Journal

Bright entertainment trends with youth appeal.

Let's say I have this python script on my VPS:

# test.py
import time
while True: print('tick...') time.sleep(10)

If I log into my VPS using SSH and run this script, I can see tick... messages appearing in the console. But if I log out and log in again, everything is gone. I can see using htop that the python script is still running, just not printing anything into my new SSH session.

Is there any way I can recover the last SSH session, so I can see the results of my script again?

I tried the screen tool (screen -S test -> python test.py), but after re-connecting to SSH, when I try to go to my screen session (screen - S test) it only prints [screen is terminating].

4

1 Answer

The command screen - S test is incorrect. If you want to re-attach to your detached screen session called "test", you should use the command

screen -R test
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy