use strict;
use warnings;
+use File::Basename;
use File::Temp qw(tmpnam);
use Filesys::Df;
use LockFile::Simple;
if (df($tiledir)->{per} > 90)
{
- system("find", $tiledir, "-xdev", "-name", "lost+found", "-prune", "-o", "-type", "f", "-name", "*.meta", "-atime", "+14", "-fprintf", $tempfile, "%A@ %p\n");
+ system("find", $tiledir, "-xdev", "-name", "lost+found", "-prune", "-o", "-type", "f", "-name", "*.meta", "-atime", "+10", "-fprintf", $tempfile, "%A@ %p\n");
open(TILES, "-|", "sort", "-n", $tempfile) || die "Can't open $tempfile: $!";
my($time,$tile) = split(/ /, $line);
unlink($tile) || warn "Can't remove $tile: $!";
+
+ for (my $dir = dirname($tile); $dir ne $tiledir; $dir = dirname($dir))
+ {
+ unlink($dir);
+ }
}
else
{