3 # DO NOT EDIT - This file is being maintained by Chef
8 use File::Temp qw(tmpnam);
11 my $tiledir = shift @ARGV;
12 my $tempfile = tmpnam();
14 if (df($tiledir)->{per} > 90)
16 system("find", $tiledir, "-xdev", "-type", "f", "-name", "*.meta", "-atime", "+45", "-fprintf", $tempfile, "%A@ %p\n");
18 open(TILES, "-|", "sort", "-n", $tempfile) || die "Can't open $tempfile: $!";
20 while (df($tiledir)->{per} > 80)
24 if (defined(my $line = readline(TILES)))
28 my($time,$tile) = split(/ /, $line);
30 unlink($tile) || warn "Can't remove $tile: $!";
46 warn "Tile expiry finished before threshold reached" if df($tiledir)->{per} > 80;