3

If I ssh to a box and start a task that will take some time to complete I usually press control+z to pause the process, and then immediately type bg 1 to put run it in the background.

I can then type jobs and see it running.

If I disconnect (type exit, press control+d, etc) and then log back in, I can no longer type jobs to see it running - it won't show anything.

I know I can type something like

ps -u `whoami`

to see what items are running, but I'm not sure if I can pause them any longer. I know I can kill them, but is there a way to pause them or can I somehow get them to show back up in the jobs list?

Linux-fu tips regarding jobs and process management are also welcome and will be upvoted.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
cwd
  • 45,389

1 Answers1

4

You can use kill -STOP pid to pause a job and kill -CONT pid to resume it. You get the proper pid from the ps command you already know.

Kyle Jones
  • 15,015