Re: Redirection output for a program in background
- From: Tony Lawrence <pcunix@xxxxxxxxx>
- Date: Mon, 10 Mar 2008 04:22:16 -0700 (PDT)
On Mar 10, 5:21 am, Tom Newton <t...@xxxxxxxxxxxxxx> wrote:
On 2008-03-10, Mad Ant <anton.har...@xxxxxxxxx> wrote:
Hello all.
I have a little question concerning the redirections of text. I know
it's possible to redirect the output when starting the program from
the command line, with pipes and greater-thans and so on.
However, I have a program that starts at boot and runs as a daemon,
which also prints text to standard output.
But since it's started at boot, I have no access to the output that's
being printed.
The question I want to ask is this : is it possible, while a program
is running, to redirect the standard output on the fly to a terminal
to see the output text being produced ?
This would be especially useful for me, since I have to sometimes
administer machines via SSH.
I know it's possible to look at the file /var/log/messages, but since
it receives all the text, I don't want to have to meander through the
files to find the text being printed from my program.
Many thanks for any help that can be provided.
Mad Ant
You could have cron run a script that greps out the lines from
/var/log/messages that you want, every N minutes/seconds, putting
them in a seperate file, then have a function that runs tail -f
on that new file with a couple of keystrokes:
cv () { tail -f /tmp/special; }
Tom
--
calhobbit (at) | The Truth will set you free:
gmail [DOT] com | http://www.sethcenter.com
No need to put it in a file if it has write permission to the terminal
you want it to appear on (of course that assumes you know where that
is).
.
- Follow-Ups:
- Re: Redirection output for a program in background
- From: Tom Newton
- Re: Redirection output for a program in background
- References:
- Redirection output for a program in background
- From: Mad Ant
- Re: Redirection output for a program in background
- From: Tom Newton
- Redirection output for a program in background
- Prev by Date: Re: Redirection output for a program in background
- Next by Date: Re: How to choose correct version of kernel...
- Previous by thread: Re: Redirection output for a program in background
- Next by thread: Re: Redirection output for a program in background
- Index(es):
Relevant Pages
|