简体   繁体   中英

How to remotely run a program with SSH independent of my current computer

So I want to run a program from my Desktop, but I would like to have my Desktop "forget it", so that if my Desktop crashes or shuts down it won't affect the SSH program.

In other words: I want the task to be executed on the remote computer independent of the computer, with which I'm sending the task.

Why would I wanna do this? Because I'm executing a huge task on a huge computer (64 cores computer), which should take days to evaluate, but I don't want my current computer to have to wait for it. The last time my Desktop froze, and I lost all the progress I had.

I can imagine that this question has been answered a million times already, but I don't know what terminology I have to search for, and I don't know what this process is called.

Thanks.

Some methods

  • Use nohup
  • Use Screen

Using Screen

Ubuntu : sudo apt-get install screen

 screen 

then after you lost ssh session.

login to ssh again and then

screen -r 

This will resume ssh session screen.

For more info man screen

You could use (on the remote big iron) the batch(1) command since you want batch processing :

  local% ssh remotebigmachine
  remotebigmachine% batch << EOB
     ./myprog param1 param2 param3 > output.txt
  EOB
  remotebigmachine% exit

In the above both local% and remotebigmachine% are shell prompts (in practice they are something different).

BTW, for batch computation running many days, it is worthwhile to program some application checkpointing (because even supercomputers may have power outages or hardware issues).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM