PS:235 – The File Issue

So about a month or so ago I picked up a gig on a software project. I talked about it recently in this post. I mentioned a file issue with how things were inserted yada yada yada. Well been working on it tonight let me give you a guide – in this image that’s about to follow, G = GOOD, image is in the database, valid, active, 100% working, B = BAD , should not be on the server, should be deleted. AKA: Using my good storage!


So you’ll note Good = 17,126 (and it stays there) however B= 120k and growing. That’s a real time comparison between the file structure and the database for uploaded images.  Oi. The entire thing just ended and this is still my dry-run but the dry run reports:

Good Records: 163,038
Bad Records: 2,270,934

That’s 2 MILLION files in the structure which have no corresponding record in the database, thus are NOT used for anything. ANYTHING. Now to adjust the app to not just scan, but delete.

Update: Already freed up 60GB of storage, gone through sections, no missing images. We may have a free hard drive soon! Woohoo!

Update 2: Really need to goto sleep exhausted, but been doing this folder by folder, and on the 9’s which I may leave till morning as it over 70GB free’d from garbage that didn’t belong. Woot!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: