I wonder, how large are these filesystems you are searching with this script? The reason I ask is that I do this type of thing quite often on very large filesystems (4tb+) and it does not take anywhere near 20 hours to run. (I think last time I timed it took less that 15 minutes). The other thing to note is you can merge find_subdirs and the other find into one section, that way you can use the magic stat var to speed up your tests across the board.