perlgsm has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
A quick stupid question.
I need to build a script to read a directory for some logs files. There is one log file (almost) per day and gets written by some server, whenever there is something interesting.
I wrote a script getting input from 'tail -q -n 0 -f /path/file-2013-11-1-31|'.. Problem is since there is date in the file name (yyyy-mm-dd) so use of wild card gets the 'available' files for me to read.
Whenever a new file is available I don't get that, I verified this by doing ps and all I had was, the available file names with tail.
Question is how to get the new files available to be read as and when they appear in the directory?
I don't know Perl IPC, but I can explore that if needed.
Somehow I'm not getting any ideas for this tricky problem.
Ideas are invited!
Thank you in anticipation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading constantly generated log files: Suggestions invited
by Kenosis (Priest) on Nov 08, 2013 at 18:10 UTC | |
|
Re: Reading constantly generated log files: Suggestions invited
by davido (Cardinal) on Nov 08, 2013 at 19:36 UTC | |
|
Re: Reading constantly generated log files: Suggestions invited
by Khen1950fx (Canon) on Nov 08, 2013 at 20:19 UTC | |
|
Re: Reading constantly generated log files: Suggestions invited
by pvaldes (Chaplain) on Nov 08, 2013 at 20:53 UTC | |
|
Re: Reading constantly generated log files: Suggestions invited
by aitap (Curate) on Nov 09, 2013 at 19:05 UTC | |
|
Re: Reading constantly generated log files: Suggestions invited
by Random_Walk (Prior) on Nov 09, 2013 at 15:06 UTC |