I would like to write a small script that does the following (and that I can then run using my crontab):
Look into a directory that contains directories whose names are in some date format, e.g. 30-10-09.
Convert the directory name to the date it represents (of course, I could put this information as a string into a file in these directories, that doesn't matter to me).
Compare each date with the current system time and find the one that has a specific time difference to the current system date, e.g. less than two days.
Then, do something with the files in that directory (e.g., paste them together and send an email).
I know a little bash scripting, but I don't know whether bash can itself handle this. I think I could do this in R, but the server where this needs to run doesn't have R.
I'm curious anyway to learn a little bit of either Python or Ruby (both of which are on the server).
Can someone point me in the right direction what might be the best way to do this?