I have a need for a specialized cleanup script that will delete files & folders according to the following rules:
I have a main folder that contains a number of subfolder with dates as their names, following this format: YYYY-MM-DD
Within those subfolders can be any number of files & folders of unknown naming convention, unknown depth.
What I need is something I can drop into the root folder which when run will check the date named folders and will delete the ones (and whatever may be within them) in which the names correspond to dates older than 2 weeks old, regardless of the actual age of the folder. (it's possible the creation/last modified date may not agree with the folder name)
I need to be able to run it without providing path information at each run, without any confirmation dialogs, without any visible windows, without any prompts or messages about there being nothing fitting those parameters to delete, etc. And it needs to exit when it is done. I do not want to be bothered or interrupted when this runs. (whether you want to send the deleted stuff to recycle bin or not is up to you, but I do not want a dialog asking me if that's what I want to do, every time this is run)
I will be running this as a daily scheduled task to remove content that has been shared via dropbox, to solve support issues more than 2 weeks prior, to ensure the customers will only receive the latest version of the content. I don't want them to be able to download it 3+ weeks later without asking for new links/new content, due to the high probability of there having been revisions and/or corrections to that content.
If there is anything about this that you are unsure about or do not understand, please ask and I will clarify it.