I have a directory with files whose names are common with a suffix of increasing date.
An example is:
REUTERS.FH_lbm_dump.20120905
representing the 5th of September.
These files are supposed to be created in the first few minutes of the next day, e.g. the above file should’ve been created at 00:01 on the 6th of September.
However, due to some bug with how the filenames are generated, an application has been saving them incorrectly. So files created at 00:16 on the 5th of September have the suffix 20120905, i.e. the filename is 1 day too late.
Output from ls -h showing the wrong naming:
2012-09-05 00:16 FH_lbm_dump.20120905
So logic to detect this would look at the file name, extract the date, and if its equal to the file timestamp it would be positive.
How can we do this in Bash / Perl / Python?
I will not solve your entire problem, but I’ll give you a place to start. The rest is really up to you.