SSH

Soldato
Joined
24 Nov 2002
Posts
16,378
Location
38.744281°N 104.846806°W
Is there a way to keep a process running when I SSH into work? I'm running a script but when I close the terminal this end, it dies at work.
 
You need to run it in the background add an ampersand to the end of the command e.g. to run a an ls command in the background I'd type:

Code:
ls -l &
 
That will still exit when you close the session, it simply returns control to the terminal. You need somthing like "screen". This will create virtual terminals that remain open even when not connected to a real terminal. When you login again you can connect back to the virtual terminal.
 
I thought so :(

I'm running a script on my mac at work that kills the internet and takes about 12hrs. The whole reason I wanted to run it at work was to free up my machine, but if it needs to stay on and connected looks like my striving towards efficieny failed.
 
I have used
Code:
nohup [i]process[/i] &
plenty of times before to invoke SETI clients on remote machines, they don't stop when you log out;)
 
Thread revival!

I'm using nohup frequently now over putty to send commands to my mac to do.

It says somehting like sending output to something. I wondered, when I log back into putty is there a way to resume the output to screen without interupting the process?
 
By default, the message is: nohup: appending output to `nohup.out'

This is simply saying that all output from the command is being sent to the file nohup.out which will have been created in whatever directory you happened to be sat in when you started the command.

If you want to "resume" seeing the output, try something like:

tail -f nohup.out

And don't worry, you can ctrl+c this without interupting the original command!
 
Back
Top Bottom