rtfd/readthedocs.org — pull request #738 by agjohnson (2014-03-17 02:27:34+00:00)
Title: Add stale build checkout cleanup command

Build cleanup finds versions where the last build date for the version is older than a specified maximum date. Build paths older than number of days specified by `--days=DAYS` (the examples below use 0 for an example only, normally this would be a sane value) are removed unless `--dryrun` is sepcified on the command:
```
% python manage.py clean_builds --days=0 --dryrun
...
[16/Mar/2014 21:19:29] INFO [core.management.commands.clean_builds:55] Found stale build path for Version latest of Kong (9) at /home/docs/sites/readthedocs.org/checkouts/readthedocs.org/user_builds/kong/checkouts/latest, last used on 2014-03-16 21:18:18.882387
```

Otherwise, a live run will produce:
```
% python manage.py clean_builds --days=0
...
[16/Mar/2014 21:17:24] INFO [core.management.commands.clean_builds:55] Found stale build path for Version latest of Kong (9) at /home/docs/sites/readthedocs.org/checkouts/readthedocs.org/user_builds/kong/checkouts/latest, last used on 2014-03-16 21:16:55.995807
[16/Mar/2014 21:17:24] DEBUG [builds.utils:76] Removing build path /home/docs/sites/readthedocs.org/checkouts/readthedocs.org/user_builds/kong/checkouts/latest for Version latest of Kong (9)
```