Tuesday 22 January 2019

ssh - Leave bash script running on remote terminal while not logged in?


I have a bash script that takes several hours to run. While it's running, I would like to do other things, which may involve logging out or disconnecting from the internet (my script runs network tests on various computers).


I understand that there is a command that would allow me to run my tests from a remote terminal and logout of the terminal while it runs. Does anyone know what this command is?



Answer



The command you are looking for is nohup.


There is also screen, which is for when you want to leave something running but come back and reattach interactively later.


nohup is simpler if a command expects no user input after launch, and screen is better if you want to be able to run the program interactively.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...