]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/templates/default/cleanup-tiles.erb
Merge remote-tracking branch 'github/pull/74'
[chef.git] / cookbooks / tile / templates / default / cleanup-tiles.erb
index 34761ba85e5201b58d6d0b3d7751549ea03e2269..5766b84cb3c43ecf823fbd5bbc55623eba3ca110 100644 (file)
@@ -18,9 +18,9 @@ $lockmgr->lock("${tiledir}/cleanup") || exit 0;
 
 my $tempfile = tmpnam();
 
 
 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", "+5", "-fprintf", $tempfile, "%A@ %p\n");
 
     open(TILES, "-|", "sort", "-n", $tempfile) || die "Can't open $tempfile: $!";
 
 
     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))
                 {
 
                 for (my $dir = dirname($tile); $dir ne $tiledir; $dir = dirname($dir))
                 {
-                    unlink($dir);
+                    rmdir($dir);
                 }
             }
             else
                 }
             }
             else