Started a long-running process over ssh, but have to leave and don't want to interrupt it? Just start a screen, use
reptyr to grab it, and then kill the ssh session and head on home.
The reptyr application allows you to open screen and migrate the process to the screen terminal and away from the terminal connection opened without screen. This allows you to detach from the window without killing the process. Below is a quick overview of installing reptyr and how to use it.
Either use yum install reptyr
Or
Use git clone To Download reptyr Source:
- git clone
https://github.com/nelhage/reptyr.git - cd reptyr/
- make
- make install
With the above commands out of the way you are now ready to use reptyr to attempt to migrate a process. To do this you must obtain the PID or Process ID of the process you want to migrate (you can use ps -ef | grep processname)and then migrate it using the below command.
reptyr -s 'PID'That's it..!!