articulate/ice-bridge — pull request #14 by appakz (2014-05-12 14:44:28+00:00)
Title: first pass at support for cleaning up files older than X days

@voidlock
Extra step following the archive step to prune files out of the folder that are older than X days. For now this is a "bolted on" step that is independent of the archival; but that's a design decision we might want to revisit in the future. This is also lacking a safety check to ensure that the file we're about to delete does exist somewhere else, but I think this is good enough for demo purposes for the time being.

This uses a couple of new config fields:

- MaxFileAge - int representing the number of days old a file has to be before we'll delete it. If this value is <= 0 we skip the cleanup all together; so you have to opt-in to this behavior.
- FileAgeMethod - this is sort of a hack to let me do testing. All of my images files are named with a date and time stamp, but because I've been uploading and re-uploading so much into a little sandbox folder for testing, the Modified stamp that Dropbox has is very recent. If this property is set to a particular value, we'll use the name of the file to denote the time stamp to know how old the file is. You'd really only ever set this for development/debugging purposes though, and it works great for demo purposes.