]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/web/templates/default/statistics.erb
Move the daily statistics to be served from planet.openstreetmap.org
[chef.git] / cookbooks / web / templates / default / statistics.erb
index ccfe956cc3fa958a72d2b4a68604d9e0ac7088d8..db1fd40edbdf4488266ea3badef3ba8b659c2220 100644 (file)
@@ -1,13 +1,16 @@
 #!/bin/sh
 
+# Abort on error
+set -e
+
 # Make sure /usr/local/bin is on the path
 export PATH=$PATH:/usr/local/bin
 
 # Generate new statistics
-<%= @ruby %> <%= @directory %>/script/statistics > <%= @directory %>/tmp/data_stats.html
+<%= @ruby %> -W0 <%= @directory %>/script/statistics > <%= @directory %>/tmp/data_stats.html
 
 # Move new statistics into place
-mv -f <%= @directory %>/tmp/data_stats.html /store/rails/stats
+rsync --quiet <%= @directory %>/tmp/data_stats.html planet.openstreetmap.org::statistics
 
 # Mail statistics to Blackadder
 mail -s "OpenStreetMap Statistics" blackadderajr@gmail.com < /store/rails/stats/data_stats.html