1

The following question has been asked millions of times (be patient towards it please :-)).. Why O why - can't I find ONE SIMPLE, CONCLUSIVE answer? - Would be highly appreciated!

  • Is running a program (What_ever_job.EXE file) in ssh as : "./What_ever_job &" enough to keep it running if my own computer is shut down and ssh is closed? If not - what is the PRECISE (Please!...) way to run it?

No "Screen" please, I have seen something called "nohup" (?) - how do I write the commend?

1 Answer 1

3

The "simple conclusive" answer is screen. I know you've said you don't want screen, but I'll give you the simple steps anyway:

  1. Log in to the remote machine using SSH
  2. Run screen (your command window will look like it's been cleared)
  3. Run whatever command you'd like. No need to use &
  4. Press Ctrl-A, then the D key

You'll be disconnected from screen, and your command window will look like it did when you logged in, though the process will still be running. Using screen also gives you the advantage of being able to reconnect to the running process after disconnecting your remote machine, which nohup will not allow.

As far as using nohup goes, I haven't actually used it, but the syntax appears to be simply nohup yourcommand &. It's worth pointing out that the Wikipedia article on nohup offers a number of other alternatives you might want to try out, such as VNC if it's available, or start-stop-daemon on a Debian-based system.

EDIT: If you'd like to start the process in a single line, you can use screen -dmS name yourcommand, where "name" can be anything, and is simply the name screen uses to refer to the background session, and "yourcommand" is the command you want to run in the background.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .