2

I am working on a collectd plugin to monitor a program I have running in a detached screen session. This program constantly updates the terminal with its status by replacing its old status (similar to programs like top, etc).

I would like to be able to grab what it is currently "showing" and parse it to get the current status of the program. I know there is a way to send text to a screen, but is there a way to grab it? Alternatively, is there another program/approach to accomplish what I am looking for?

Alex
  • 123

2 Answers2

1

That'd be the hardcopy command.

screen -x yoursession -X hardcopy /path/to/your/file

Would cap what the terminal is currently showing, without backlog, to the given file.

frostschutz
  • 48,978
1

Is something like

 screen -Xx <screen_nr> hardcopy outfile.txt

what you are looking for?

Also take a look here.

Runium
  • 28,811