2

I forgot to use screen and I have a task that has been running for quite some time, and I do not want to lose the saved data. Basically Ctrlc will end the task and save the data if I am on the same terminal session, is there a way to stop it in different SSH window?

I do not have access to the same terminal window at the moment.

andyADD
  • 121

2 Answers2

8

C-c sends SIGINT to the foreground process group, you can kill it using kill on the foreground process group id (see ps -ej output).

kill -s INT -- -pgid
Chris Down
  • 125,559
  • 25
  • 270
  • 266
  • thanks i will remember this next time, I just tried to ssh in and the system rebooted so I lost the data :| – andyADD Apr 05 '13 at 02:50
2

There are several utilities that are able to change the tty of a running process. Most of them written exactly for the purpose of attaching a running process into a terminal multiplexer - see e.g.:

peterph
  • 30,838