h123 has asked for the wisdom of the Perl Monks concerning the following question:
Hi I am new to pearl and have been asked to create a perl script that executes a stats command on a program on our server.
The program on our server generates lines of stats every minute as follows(it runs indefinetly until you hit ctrl +c):
HH:MM:SS - 1,2,3
HH:MM:SS - 1,2,3
I want to runs this stats program so it always runs in the background and capture the output to a fifo. I then want read the last 30 lines(to give me the last 30 mins) in the fifo and write this to a actual file e.g. <timestamp>.csv (this file is then collected by a graphing program)
Can anyone suggesest the best way to do this. I have been googling and it seems like the best way is using forks and fifo's (which is all new to me)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with fork, read and write from a pipe
by zentara (Cardinal) on Jan 22, 2014 at 16:18 UTC | |
|
Re: Help with fork, read and write from a pipe
by McA (Priest) on Jan 22, 2014 at 16:31 UTC | |
by h123 (Novice) on Jan 27, 2014 at 09:15 UTC | |
by McA (Priest) on Jan 27, 2014 at 15:59 UTC | |
|
Re: Help with fork, read and write from a pipe
by Anonymous Monk on Jan 22, 2014 at 20:00 UTC | |
|
Re: Help with fork, read and write from a pipe
by Anonymous Monk on Jan 23, 2014 at 05:49 UTC |