I had an incident recently where some files were accidentally deleted. These are files on a shared webhosting account (FreeBSD), but the directory tree is deep.
My inclination is to write something myself in PHP or Python that does this:
- Scan each and every directory for the number of files contained in each
- Store that data, probably in a MySQL database
- Run a report daily that tells me where there's activity (so, I'd see that the uploads directory has 3 new files, or that the thumbnails directory has 10 fewer files in it, or even on a per-file basis tell me it's changed (maybe it takes a hash of each file and stores that?).
- Run a daily cron job with the changes from the day before (or weekly cron job with changes from the week before, or whatever interval makes sense)
But I sense that this is something people have done before me. Does this exist and I just don't know it?