-template "/etc/cron.d/cleanup-tiles" do
- source "cleanup-tiles.cron.erb"
- owner "root"
- group "root"
- mode 0o644
- variables :directories => tile_directories
+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