reptyr is a wonderful little utility for Linux systems which enables you to reattach long running processes in screen or tmux. Great if you started something and have to close ssh.
In order to install, you need to clone the repository, run make and copy the
reptyr binary to some directory in your
$PATH. Typical usage works like this:
- Start a long running process, e.g.
- Background the process with CTRL-Z
- Resume the process in the background:
- Display your running background jobs with
jobs -l, this should look like this:
+ 4711 Stopped (signal) top
jobs -lmakes sure you'll get the PID)
- Disown the jobs from the current parent with
disown top. After that,
jobswill not show the job any more, but
- Start your terminal multiplexer of choice, e.g.
- Reattach to the backgrounded process:
- Detach your terminal multiplexer (e.g. CTRL-A D) and close ssh
- Reconnect ssh, attach to your multiplexer (e.g.
tmux attach), rejoice!
I think reptyr is the perfect companion for tmux and should be installed on every Linux box, just like tmux.