Skip to main content

Thank God for backups

I was writing a tool in python to automatically move images into a directory hierarchy based on the stored EXIF date...Everything was working great until I decided that I should run it on ALL of my images, even those which were already in the correct location. The program as written did something like this: - Oh, you want to move file /pics/2004-12-21/dscn001.jpg? Ok, where should it go? - Based on the date, it should be renamed to /pics/2004-12-21/dscn001.jpg - Does that already exist? Yup! - Do the SHA-1 sums match? Yup! - Therefore I must have copied the file there before, delete the original! That last step, by the way, was added to prevent duplicate images from accumulating all over my hard drive. It works great when the "source" and "destination" files are actually different! Good thing I've got backups. The only problem is that it takes forever to recover as they're all on CDs.