Hello,
We've got a HUGE folder where we keep copies of databases, contracts, documentation etc etc for years and years. The data we generally receive or store as .zip files, but from time to time someone needs to look at it, so it's unzipped and forgotten. I've
had the long talk about how unneccessary and wasteful this is, but the owners still want it. "Just in case of something".
Some of these files are database dumps 1gig+, sorted in about 400 folders with 5-8 subfolders each, which again can have 10+ subfolders. A nightmare to keep tidy.
What would help me greatly is a script that does the following:
- Finds all .mdb, ldb, mdf, bak, dmp files older than 180 days and zips them as individual files in the same folder, keeping the filename (but of course changing extension to .zip), and then deletes the original files. Exception: If there is already a .zip file with the same name, I'd like a log/report telling me where, so I can compare dates of the original file and the one in the .zip file (and delete the original if they are the same). Or can this part be scripted as well?
EDIT: Can date of the original file be included in the .zip (originalname-date.zip)?
- Finds all .TXT files older than 180 days and bigger than 10MB, zips them as individual files in the same folders and keeping filename (extension change ok) and then deleting the original file.
- Deletes all empty folders (because users tend to be locked out from deleting folders because of thumbs.db)
Any good ideas or links? I've had rotten luck finding anything doing exactly or close to this, and I'm pretty rotten at scripting.. I'd like to run this script every weekend as a scheduled task.
Best regards and have a nice weekend!