0

I have two pc on my home network. One of them is the Raspberry Pi. The Raspberry Pi has static IP. I connect with it, through my another pc, with ssh user@ip. But if I put a long process run I have to leave my pc power on.

How can I put long or short process run on my raspberry (or another machine with Linux) and shutdown the machine with I used to connect the raspberry?

muru
  • 197,895
  • 55
  • 485
  • 740

1 Answers1

0

You can do this through screens...

  1. On the raspberry pi run the following commands to install Screen:

    sudo apt-get update

    sudo apt-get install screen

  2. Once it has installed simply type:

    screen

    followed by Enter

  3. Now run whatever long or short process you need..

  4. Now you simply have to "detach" the screen by pressing the following:

Ctrl+A

then d

Now you can disconnect from the raspberry pi and it will continue running in the background. If you want to "re-attach" to that screen, simply reconnect to the raspberry pi and type:

screen -r

If you need to do this again there is no need to reinstall screen so just start at step 2!

Good luck!

Trevor Clarke
  • 892
  • 6
  • 18
  • Thank you all for your quick answer.

    I install tmux and I am using now and I like that! Especially the function to create a various session ;) good that!

    I will test the screen program and report about that! We may consider that these two programs are the same thing? Which are the difference between both?

    Thanks

    – Edgar Oliveira Dec 30 '15 at 11:08
  • Screen is only one session at a time, and u can detach from it and disconnect from your computer. As far as I know you can't do that in tmux – Trevor Clarke Dec 30 '15 at 14:21