]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/cleanup-tiles.erb
Merge remote-tracking branch 'github/pull/713'
[chef.git] / cookbooks / tile / templates / default / cleanup-tiles.erb
index 34761ba85e5201b58d6d0b3d7751549ea03e2269..721660bb16795b234bf5779c91e76b099578f11d 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", "+2", "-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