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)
In reply to Help with fork, read and write from a pipe by h123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |