]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/cleanup-tiles.erb
Allow overwrite when updating forum style
[chef.git] / cookbooks / tile / templates / default / cleanup-tiles.erb
index 34761ba85e5201b58d6d0b3d7751549ea03e2269..eb108e95e7d0c13f25034c02d1bc4c0c535a30e4 100644 (file)
@@ -18,9 +18,9 @@ $lockmgr->lock("${tiledir}/cleanup") || exit 0;
 
 my $tempfile = tmpnam();
 
-if (df($tiledir)->{per} > 90)
+if (df($tiledir)->{per} > 88)
 {
-    system("find", $tiledir, "-xdev", "-name", "lost+found", "-prune", "-o", "-type", "f", "-name", "*.meta", "-atime", "+10", "-fprintf", $tempfile, "%A@ %p\n");
+    system("find", $tiledir, "-xdev", "-name", "lost+found", "-prune", "-o", "-type", "f", "-name", "*.meta", "-atime", "+3", "-fprintf", $tempfile, "%A@ %p\n");
 
     open(TILES, "-|", "sort", "-n", $tempfile) || die "Can't open $tempfile: $!";
 
@@ -38,7 +38,7 @@ if (df($tiledir)->{per} > 90)
 
                 for (my $dir = dirname($tile); $dir ne $tiledir; $dir = dirname($dir))
                 {
-                    unlink($dir);
+                    rmdir($dir);
                 }
             }
             else