in reply to Will checking last modified date take more time than just overwriting?
In general terms, I would think that checking the last modification date will almost always be better than simply overwriting files (checking the last modification time is a very fast system call), although it is true that it really depends on the number of files, the file size, the modification frequency and factors more complicated to take into account (for example: are the large files more likely to be modified than the small one, or is it the opposite? etc.)
Another point: if I understood correctly your code (which I read only very quickly), you are comparing the file last modification time with the same parameter on the backed up file. You should probably have a small database (a tied hash, whatever) so that you don't need to check the back up last modification time. In fact, it can be even simpler: you only need to remember the last time you ran a backup. Any more recently modified file needs to be backed up, any older file needs not.