alphagov/fabric-scripts — pull request #86 by mattbostock (2014-12-23 15:03:08+00:00)
Title: [#74851568] Task to delete stale Whisper files

Add a task to delete stale [Whisper][] files, as used by [Graphite][].

The task will delete Whisper files that have not been modified in over
90 days, then remove any empty directories left as a result.

The rationale behind this is that if a metric has not been updated in 90
days, it is likely an artefact of historical configuration and is no
longer used.

Under certain circumstances, a current and valid metric may not be
updated in a long time, for example a metric tracking HTTP 500 errors
may not update if no error has occurred over the period in question.
This is unusual however, and it's unlikely that we draw enough value
from those metrics to be concerned about deleting them.

Note that `find(1)` uses the `-type` argument to target files only; the
modification times for directories do not change when the files they
contain are modified.

Also, uses `rmdir(1)`, which will refuse to delete a non-empty
directory.

[Graphite]: https://github.com/graphite-project/graphite-web
[Whisper]: https://github.com/graphite-project/whisper