X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/c7196d4f1b57816f974c8efa1c13ddefd48a212a..168654c76af6d2d6193a15051e684b9b6bfde0ab:/cookbooks/tile/recipes/default.rb diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 5dafa2fd8..c5dc7c87f 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -578,12 +578,19 @@ tile_directories = node[:tile][:styles].collect do |_, style| 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"