sc3/cookcountyjail — pull request #145 by bepetersn (2013-10-05 05:28:18+00:00)
Title: cron.sh: make a backup after each scrape; nginx: statically serve latest backup

As title suggests, two important changes.

- After finishing the scrape, cron.sh now does ./manage.py dumpdata countyapi, and saves the result as a backup; a secondary action it takes is to create a symlink to the backup called latest.json in the same directory.

- Secondly, the nginx.conf file should now statically serve the latest backup file under the URI '/clone'.

Also, I've already manually made a first backup on the server itself, and made a symlink to it called 'latest.json'. Between the changes in these two files and the changes already on the server, I believe everything would work out of the box. Running on Nginx and Gunicorn on my localhost, I got a comparable solution working. However, I'm not sure if there's any way to be certain that it all works without letting it run the next scrape.