I'm currently redirecting the output of a monitoring tool to a file, however what I'd like to do, is to redirect this output to a new file on my request (using a keybinding), without stopping the said tool.
monitor_program | handle_stdout
handle_stdout allows me to define a new file where to put the log at certain point.
I know I could easily write it, but I'm wondering if there's any tool that already allows this.
logrotatewith a custom config file manually, depending on the behaviour of your monitor_program, but that's somewhat hackish.