Greetings!
Just stuck with a problem. I would have to grep through several log files with fixed size rotation and with date and time in their name.
(It means that the rotation time can be considered random.)
(example:
Code:
/path/to/log/logfile-name.log.{yy}-{mm}-{dd}-{hh}-{mm}-{ss}
)
I would like to find the apropriate files by name. There can be several so I would like to use find rather more than ls.
Would like to work with several log files once but the problem is p.e.:
Code:
find /path/to/logs/ -name 'logfile-name.log.$(date +"%Y-%m-%d")--05_[0-6][0-9]_[0-6][0-9]'
finds me the files rotated\started in the 05:00 - 05:59 period.
This part is fine but I would need the preceeding and the following one file too in this list.
Only one before and only one after.
(p.e.: filename.log.yy-mm-dd-04-55-22, {filename.log.yy-mm-dd-05-*.*} , filename.log.yy-mm-dd-06-02-00
The number of files can vary, the previous and next needed files can be with any name.
I would like to grep and (p.e.) wordcount for all the files resulted here.
I would prefer a find solution than an ls one but other solutions are also welcome!
I hope my problem is clearly outlined and I hope you have some fine suggestions to solve it.
Thanks in Advance!
--
R