X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/fc69a33d6cab4f2279f3ca0e6df518dbc59a78e0..1bc8da5f3a3bfd6c3f0ba374f12d489d13831460:/cookbooks/tile/templates/default/cleanup-tiles.erb diff --git a/cookbooks/tile/templates/default/cleanup-tiles.erb b/cookbooks/tile/templates/default/cleanup-tiles.erb index 34761ba85..721660bb1 100644 --- a/cookbooks/tile/templates/default/cleanup-tiles.erb +++ b/cookbooks/tile/templates/default/cleanup-tiles.erb @@ -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