style[:tile_directories].collect { |directory| directory[:name] }
end.flatten.sort.uniq
-template "/etc/cron.d/cleanup-tiles" do
- source "cleanup-tiles.cron.erb"
- owner "root"
- group "root"
- mode 0o644
- variables :directories => tile_directories
+file "/etc/cron.d/cleanup-tiles" do
+ action :delete
+end
+
+tile_directories.each do |directory|
+ label = directory.gsub("/", "-")
+
+ cron_d "cleanup-tiles#{label}" do
+ minute "0"
+ user "www-data"
+ command "ionice -c 3 /usr/local/bin/cleanup-tiles #{directory}"
+ mailto "admins@openstreetmap.org"
+ end
end
munin_plugin "mod_tile_fresh"
+++ /dev/null
-# DO NOT EDIT - This file is being maintained by Chef
-
-MAILTO=admins@openstreetmap.org
-
-<% @directories.each do |directory| -%>
-0 * * * * www-data ionice -c 3 /usr/local/bin/cleanup-tiles <%= directory %>
-<% end -%>
variables :totp_key => web_passwords["totp_key"]
end
-template "/etc/cron.d/tilecache" do
- source "cron.erb"
- owner "root"
- group "root"
- mode 0o644
+file "/etc/cron.d/tilecache" do
+ action :delete
+end
+
+cron_d "tilecache-generate-qos-map" do
+ minute "0"
+ user "root"
+ command "/usr/local/bin/nginx_generate_tilecache_qos_map"
+end
+
+cron_d "tilecache-curl-time" do
+ user "www-data"
+ command "/srv/tilecache/tilecache-curl-time"
+end
+
+cron_d "tilecache-curl-time-cleanup" do
+ minute "15"
+ hour "0"
+ user "www-data"
+ command "/srv/tilecache/tilecache-curl-time-cleanup"
end
execute "execute_nginx_generate_tilecache_qos_map" do
+++ /dev/null
-# DO NOT EDIT - This file is being maintained by Chef
-
-0 * * * * root /usr/local/bin/nginx_generate_tilecache_qos_map
-* * * * * www-data /srv/tilecache/tilecache-curl-time
-15 0 * * * www-data /srv/tilecache/tilecache-curl-time-cleanup