Ok here's a quick question. I have a debian server with sass (driven by ruby) installed. To compile a sass file to a css file, yo do:

sass --watch style.scss:style.css

If I run this on my server through a terminal. Is that process still running when I close the terminal? If not, how do I keep it running? And how do I stop it if I want to?

link|improve this question

33% accept rate
feedback

1 Answer

up vote 1 down vote accepted

If you want a process to be running even when you disconnect from a server, use nohup.

nohup sass --watch style.scss:style.css &

The & will start the job in the background. nohup makes sure that even when you log out, the process continues. Every output will be logged to nohup.out.

You can also have several output files for stdout and stderr:

nohup --watch style.scss:style.css > main.log 2> err.log &
link|improve this answer
Wow! Thank you! How can I stop the process? – tbleckert Jun 23 '11 at 10:17
I guess you would have to run ps aux | grep nohup | grep -v grep and then run kill PID where PID is the number in the second column. Haven't found a better way to do that yet. – slhck Jun 23 '11 at 10:20
Oh ok thank you :) – tbleckert Jun 23 '11 at 10:21
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.