14
6
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?
I looked at nohup right now and apparently there are issues with input and output which might cause the script to hang up. I also saw something about screen, which strikes me as what I had read about before. Do you know how to use either of these? – Ritwik Bose – 2010-02-21T17:18:21.890
1nohup is for when a script expects no user input - it saves all output to a file. Screen 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 ably to run the program interactively. – Justin Smith – 2010-02-21T17:22:31.600
Ah found it. For screen, it's ctrl-A d to detach and -r +pid to reattach. – Ritwik Bose – 2010-02-21T17:23:39.367
Good answer. You should add the screen comment to you answer so that it stands out more. – DaveParillo – 2010-02-21T22:13:01.390