Use native bash to detect processed files.

Grep is quadratic in number of hours processed. It was too slow.