0

Is there a way, in vanilla bash (no additional packages), to start a process, somehow detach it or send it to the background, and then pick it back up later?

My specific use case is to ssh to a machine, start a long-running program (like a database backup), close my ssh terminal and have the program continue, then later be able to ssh back in to the machine and re-attach/reclaim the process in my terminal (assuming it's still running).

I know of the screen package, and given the volume of recommendations I've received about it, I think I'll give it a try in the future. One point to clarify though is that my question is in general about bash, not just specific to ssh. I'd like to be able to do the same thing locally and issue a long-running command, then close my terminal.

From my reading, I'm starting to get the impression that this might be an ill-posed question. If so, can someone suggest to me which component(s) I might need to dig into a little deeper.

1
  • Check the "screen" tool. It should probably do what you need. May 4, 2014 at 3:52

1 Answer 1

1

You can't. There are ways to leave a program running in the background after you go, but to be able to reconnect later and interact with it, you need screen or a similar program.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.