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.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
andyADD
  • 121
  • 3

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
Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501
Chris Down
  • 122,090
  • 24
  • 265
  • 262
  • 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,520
  • 2
  • 69
  • 75