uniq_

experimenting with sending processes to backround

Sometimes I run tasks over ssh without starting screen first. I tend to regret that. So started experimenting with detaching running processes from the shell. (I'm using zsh btw. so this might not work with other shells)

Note this is just experimental, don't expect this to work. And never trust this for keeping critical processes alive.

# press [CRTL+Z] for putting a already running prozess in background

# display a list of jobs
jobs

# make a process run in background
bg %1

# keep the process running even when the termianl (ssh connection) quits
# in bash this should be: disown -h %1
disown %1

# find pids of disowned processes:
ps aux | grep commandName

# bring a disowned process to the foreground:
reptyr 1234

source: http://serverfault.com/questions/55880/moving-an-already-running-process-to-screen

written by uniq on 2015-11-08