Bitcoin Forum

Bitcoin => Mining support => Topic started by: mackminer on October 07, 2011, 10:44:51 PM



Title: Running a script in the background that will run even when logged off
Post by: mackminer on October 07, 2011, 10:44:51 PM
Hi there,
I have a script running on Linuxcoin that monitors the temps on my cards where it will shut it down should it exceed my set temp.

At the moment I'm running it in the terminal I'm logged into but I'm afraid that I'll lose my ssh connection or something.

Any ideas?

Thanks a mill.


Title: Re: Running a script in the background that will run even when logged off
Post by: teek on October 07, 2011, 10:48:40 PM
You could use screen if you want to re-connect to the output.

or put an "&" at the end of your command and it will run it as a background process


ie:  # ./myscript &



Title: Re: Running a script in the background that will run even when logged off
Post by: mackminer on October 07, 2011, 11:07:03 PM
Thanks for that. If I put the & after can I see if it's working are check the output every now and again?

Not sure how to use screen. I set it up once and then logged off. I tried to look at the screen sessions and wasn't there seemingly.  ???


Title: Re: Running a script in the background that will run even when logged off
Post by: teek on October 07, 2011, 11:09:42 PM
to use screen just run screen, then run the app you want to use normally (no &)

when you reconnect to the box via ssh, do a screen -r to grab your session back



Title: Re: Running a script in the background that will run even when logged off
Post by: mackminer on October 07, 2011, 11:41:46 PM
Brilliant thanks.