Sunday 25 August 2019

unix - How to keep program running after SSH disconnection?




Possible Duplicates:
Keep a program running after closing a console, after the program has started
How can I use ssh to run a command on a remote Unix machine and exit before the command completes?



Hi!


I want to run program from my notebook by SSH-connection to remote server. The problem is I am going home with my notebook :)


How to keep program running?



Answer



'screen' is most likely what you want. It allows you to disconnect and reconnect at will. After you SSH into the server, run screen before starting your program. Ctrl-a, Ctrl-d will disconnect you (the program continues regardless). On your return, 'screen -r' will reconnect you as if you'd never been away.


Think of it as VNC or RDP for text terminals. Search for 'using screen' for many tutorials.


Edited to add: These days I would recommend tmux instead, especially if used in conjunction with the script tmx. The ability to split panes (vertically and horizontally) and resize them is a huge boon over screen.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...