Nimesh Doshi
Nimesh Doshi

Reputation: 1

to keep the script running even after internet connection goes off

I had putty on one server and run a python script available on that server. That script keep on throwing output on terminal. Later on, my internet connection went off but even then i was expecting my script to complete it job as script is on running on that server. But when internet connection resumed, I found that script has not done its job.
So is this expected ? If yes, then what to do to make sure that script runs on server even though internet connection goes off in-between?

Thanks in advance !!!

Upvotes: 0

Views: 876

Answers (2)

puckipedia
puckipedia

Reputation: 891

On the server, you can install tmux or screen. These programs run the program in the background and enable you to open a 'window', If I use tmux:

Open tmux: tmux

Detach (run in background): press Ctrl-b d

reattach (open a 'window'): tmux attach

Upvotes: 0

Andrew Jaffe
Andrew Jaffe

Reputation: 27077

You should use screen which will let you "detach" your process from the actual terminal you're in.

Upvotes: 1

Related Questions