|
|
#1 |
|
Guest
Posts: n/a
|
How to kill ssh without killing another process?
Ok, that was a bad title. What I'm trying to do is ssh into another machine, and start a big fat job. Then I'd like to close my ssh session (without killing the rotund job), and check the status later. Fer example, let's say I'd like to let fink run all night without having to be ssh'ed in the whole time:
% ssh otheruser@othermachine.net [othermachine:~] otheruser% fink update-all Should I do 'fink update-all &' to background the process instead? Thanks. |
|
|
|
#2 |
|
All Star
Join Date: Jan 2002
Location: CO, USA
Posts: 908
|
Safest way would be
Code:
nohup fink update-all > /tmp/fink.log 2>&1 & Code:
nohup fink update-all >& /tmp/fink.log & |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
Cool, that takes care of step 1 (be able to kill ssh without killing fink update-all), and step 2 (make a log of fink's output to peruse later). Thank you. One last question, though, just for clarification. I could start 'fink update-all' with nohup, and then just hit ^d (Ctrl D) to close the ssh session without affecting the process I've just started, right?
|
|
|
|
#4 |
|
Major Leaguer
Join Date: Sep 2002
Location: Earth
Posts: 381
|
correct...
check the man page for nohup man nohup the nohup basically stop the process from being affected by the terminal that ran it, ie it won't die when you log out... The only thing.... obviously you can only runn commands that are not going to want input from the terminal. Cheers, --Zed
|
|
|
|
|
|
#5 |
|
Triple-A Player
Join Date: Apr 2002
Location: Restaurant at the End of the Universe
Posts: 171
|
TiMan,
This is what I do. Login-ssh screen fink update-all ^a then d (Cont -a then d, detaches) close ssh session. course you need to install screen. -hth
__________________
—bakaDeshi Caution! Mac User at the Command Line. |
|
|
|
|
|
#6 |
|
Guest
Posts: n/a
|
Thanks everyone! I had wondered if screen would do this. I guess I'll have to try both ways.
|
|
![]() |
|
|